Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change user principal name on Azure AD

I'm trying to change the user principal name on my Azure AD user using a PowerShell command Set-MsolUserPrincipalName that I found in the Microsoft documentation here. This works fine and changes the user principal name, but it also changes the email property to the same value as well.

Example command:

Set-MsolUserPrincipalName -UserPrincipalName "[email protected]" -NewUserPrincipalName "[email protected]"

Is there another way to change the user principal name without affecting the email of the user?

like image 863
Marijan Brezovic Avatar asked Oct 27 '22 13:10

Marijan Brezovic


1 Answers

There is no way to change the user principal name without affecting the email of the user. The mail property is read-only, and the principal name should map to the user's email name.

Enter image description here

like image 51
Tony Ju Avatar answered Nov 15 '22 05:11

Tony Ju