Created
September 14, 2016 21:04
-
-
Save mortenya/ce646a8f50e523679739caf1f5e8aaf5 to your computer and use it in GitHub Desktop.
We didn't have an Exchange server on site with everyone's mailbox, and this was a requirement for migrating from GroupWise to Exchange Online.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$users = get-aduser -Filter * -Properties proxyAddresses,EmailAddress | |
foreach ($u in $users) { | |
if (!($u.proxyAddresses -contains "SMTP:$($u.EmailAddress)")) { | |
$u.proxyAddresses.Add("SMTP:$($u.EmailAddress)") | |
Set-ADUser -Identity $u.SamAccountName -Add @{ 'proxyAddresses' = $($u.proxyAddresses) } | |
} | |
else { | |
Write-Host "$($u.name) already had the correct proxyaddresses" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment