Change all users' UPN using powershell
Posted on 2008-10-29
I need to change UPN suffix for all of my users. I know that I can change one user's UPN using powershell and the Set-mailbox command. I'm trying to figure out the syntax to do all users. I wish there was a parameter for just the SUFFIX of the UPN, but I haven't found anything on that. So, to change all users, I exported them to a csv file and corrected the UPN in that file. I was going to run the following command to change the UPN, but I'm getting complaints about the the syntax.
Import-csv c:\users.csv | Set-Mailbox -Identity $_.identity -UserPrincipalName $_.upn
Can someone give me some guidance? Thanks so much.