top of page

AD/AAD Hybrid - Change user name onmicrosoft.com

Updated: Aug 21, 2022

It happens, users change their last name. Example: They are getting married. Beside some happy congratulations - what can a Cloud Amin do, to convince Active Directory and Azure Active Directory to keep the old and the new name/email address for a user and marry the two systems ?



After some research this worked for me:


Go to Active Directory Users and Computers Choose the user account where you want to change the last name Change the Email Address in the General Field Tab Go to View and select Advanced Features

Go to properties

Go to Attribute Editor

Edit and add the main Proxy Address (written in upper case SMTP) to SMTP:"davidcnew@contoso.com"


Edit all the other attributes related to the new name


Check if AD Connect has no sync issues and syncs the new attributes to Azure AD Change the user ID for onmicrosoft.com with adding the Shell Module : MSOnline

Open PowerShell as Admin Connect to the online service with the following commands: $msolcred = get-credentialconnect-msolservice -credential $msolcred (Note: Enter your Office 365 credentials when prompted) Enter the command to update the user name:

Set-MsolUserPrincipalName -UserPrincipalName "davidcold@contoso.com" -NewUserPrincipalName "davidcnew@contoso.com"







Comments


bottom of page