Microsoft 365 – Changing default username in Azure AD Connect synced environment

Last Updated: December 6th, 2023/Published On: July 11th, 2019/By /Views: 19066/

Issue: If a user was imported via AD but shows up with the wrong username on the O365 side (ending in


  1. Go to Active Directory Users and Computers
  2. Go to View and select Advanced Features
  3. Go to properties of user account
  4. Go to Attribute Editor
  5. Edit Proxy Address to:
  6. Open PowerShell as Admin
  7. Connect to the online service with the following commands: (If needed Install-Module MSOnline)
    1. $msolcred = get-credential
    2. Connect-MsolService -Credential $MSolCred
      (Note: Enter your Office 365 credentials when prompted)
  8. Enter the command to update the user name:
    1. Set-MsolUserPrincipalName -UserPrincipalName -NewUserPrincipalName

Changes should take effect within a few moments and set this user as the default username

Table of Contents