Created
October 26, 2015 15:12
-
-
Save jespernohr/dcf527c34067935fdcf1 to your computer and use it in GitHub Desktop.
This file contains 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
# use this script to add the userprincipalname as pimary SMTP to the proxyaddress attribute of a user object. | |
$users = Get-ADUser -Filter {EmailAddress -like "[email protected]"} | |
foreach($item in $users) | |
{ | |
$UPN=$item.UserPrincipalName | |
write-host $UPN | |
set-aduser -identity $item -add @{proxyAddresses="SMTP:"+$UPN} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment