Mar 12 2020 06:24 AM
Hi Community,
I have a small requirement of which I have to bulk change the User Principal Name and I have found few ways to achieve the same:
The website given below outlines the way this can be achieved. But the problem with this site, is that I am unable to understand which software tools the author has used to achieve this, and also there is some code snippet attached and couldn't understand where to copy and paste that code in the software that he used earlier.
http://www.macaalay.com/2016/08/12/changing-user-principal-names-in-bulk-on-azure-active-directory/
So for someone having idea with Microsoft products, can you please me out in describing the software used and where can I execute the provided code on the software. So that it can help me achieve the required objective.
Mar 12 2020 06:37 AM
Mar 12 2020 09:54 AM
Thanks @HotCakeX!
@KNDheerajHello! You've posted your question in the Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions. I'm moving your question to the Azure Active Directory space- please post AAD questions there in the future.
Mar 23 2020 09:30 AM
@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.