Forum Discussion
Bulk Update User Info in Azure Active Directory
KNDheeraj if you don't really know what you are doing then this is somewhat dangerous. Running someone else's script without understanding it could cause you some serious issues that you cannot fix.
Also, even if this works do you understand the implications? The users must be aware and will need to sign in to applications using the new UPN. They may need to log out of some applications and back in again, and may need to tell the apps to forget the old ones.
I assume you have a global admin account?
That being said this is how you can do it. On Windows, search for 'powershell ISE'. Don't left click on the search result, but right click and choose 'run as administrator'.
When it opens, there should be 2 halves, a white one and a blue one. If not find the button at the top that says 'show script pane' and click in those until you have white at the top and blue at the bottom.
Then paste this into the white area:
Install-Module MSOnline
Hit the play button in the toolbar. This should install after a while, click Yes to all to any warnings.
Now, paste that guys script into the white area (replacing the bit above), modify the domains to suit and hit play again.
Finally, check that everyone's UPN has changed by typing get-msoluser in the bottom and then return.