Wednesday, January 9, 2019

Office 365 Migration Issue

While migrating a client to O365 Exchange Online, I encountered an issue with mailboxes not syncing. After some quick troubleshooting it was determined they lacked the "" proxy address, required for the sync.

Below is the PowerShell script I wrote to add a proxyAddress to all users in the specified OU:

Import-Module ActiveDirectory 
$searchbase = "OU=OrgUnit,DC=DomainName,DC=Suffix"
$newdomain = ''
$users = Get-ADUser -SearchBase $searchbase -Filter * -Properties SamAccountName
ForEach ($user in $users) {
    $SamAccountName = $user.SamAccountName
    Set-ADUser -Identity "$SamAccountName" -Add @{
        'proxyAddresses' = "smtp:$SamAccountName‎" + $newdomain
    Write-Host "Adding proxyAddress to $SamAccountName"

No comments:

Post a Comment