Microsoft 365 – Changing default username in Azure AD Connect synced environment
Issue: If a user was imported via AD but shows up with the wrong username on the O365 side (ending in .onmicrosoft.com)
Resolution:
- Go to Active Directory Users and Computers
- Go to View and select Advanced Features
- Go to properties of user account
- Go to Attribute Editor
- Edit Proxy Address to: SMTP:user@domain.com
- Open PowerShell as Admin
- Connect to the online service with the following commands: (If needed Install-Module MSOnline)
- $msolcred = get-credential
- Connect-MsolService -Credential $MSolCred
(Note: Enter your Office 365 credentials when prompted)
- Enter the command to update the user name:
- Set-MsolUserPrincipalName -UserPrincipalName user@company.onmicrosoft.com -NewUserPrincipalName user@domain.com
Changes should take effect within a few moments and set this user as the default username