How to change the UPN of a user in Azure Active Directory through PowerShell

You can use the Set-MsolUserPrincipalName cmdlet in the Azure Active Directory PowerShell module (click to learn how to install) to change the User Principal Name (UPN) of a user in the Azure Active Directory (AAD). The UPN is the name that identifies a user in an Active Directory environment and is typically in the format of an email address (e.g. user@example.com).

For example, if you want to change the UPN of a user from user@example.com to newuser@example.com, you will run the following command:

Set-MsolUserPrincipalName -UserPrincipalName user@example.com -NewUserPrincipalName newuser@example.com

You must have the necessary permissions in AAD to run this command.

Was this article helpful?

Related Articles

Leave A Comment?