Update Mail and UserPrincipalName Attributes to be the same as ProxyAddress?
hello
i have ad environment imap mail system migrating office365.
i have script use add smtp addresses proxyaddresses attribute each user in ad. calls csv file have 2 columns - 1 heading "name" , 1 heading "proxy":
"import-csv file.csv | foreach {get-aduser $_.name | set-aduser -add @{proxyaddresses = ($_.proxy -split ";")}}"
i need users upn , mail attributes same primary smtp proxyaddress o365 userid, there way this? i've seen lot of examples in other blogs using quest management tools scripts
thanks
hi fred
thanks response. command work though, , has never thrown errors while entering in new proxy addresses required file (either in smtp: or smtp: format).
however, looking @ command line have replied with. tried play around command provided , replace values upn in way:
import-csv file.csv | foreach { $userprincipalname = $_.upn -split ";" ; get-aduser $_.name | set-aduser -add @{ userprincipalname = $userprincipalname } }
however threw me error immediately:
"set-aduser : multiple values specified attribute can have 1 value"
all did change "add" "replace" upn have 1 value. correct script now:
import-csv upntest.csv | foreach {get-aduser $_.name | set-aduser -replace @{userprincipalname = ($_.upn)}}
tested , works perfectly.
thanks in pointing me in right direction.
cheers
marooner
Windows Server > Windows PowerShell
Comments
Post a Comment