I normally use AD Modify to modify users' UPNs. But it is only really practical when you are changing the UPN's per OU.
Lets say you were migrating from a different messaging platform , like Lotus Notes or GroupWise. But AD had the mailnickname attribute populated and the correct UPN added into your AD. To run the script you need to do the following
- Create a csv mail.csv and place it in the root C:\mail.csv. The heading of the csv will be 'mail' and then all the mailnicknames like firstname.lastname@example.org
- On line 29 add in the distinguished name of the domain/forest scope
- Create a folder C:\logs to analyse any errors
- Watch out for ' which are acceptable characters in a smtp email address but unacceptable as a UPN in Office365.
- The script can be downloaded HERE.
The author of the script is a colleague of mine Adam Smith