Change an office 365 username synced with Active Directory
- By : Dom
- Category : Office 365
- Tags: Office 365, Powershell

Office 365 usernames obtained from dirsync cannot be changed even if updated in Active directory. It maybe necessary to change them (eg, user gets married, entered incorrectly and synced).
First, update in AD
Next run powershell as an Administrator. You need to modify Microsoft windows azure directory (not exchange)
1. Connect to Windows Azure using the following:
Import-Module MsOnline
$cred = Get-Credential (enter your email address and password at prompt)
Connect-MsolService -Credential $cred
2. Run following cmdlet: ‘Set-MsolUserPrincipalName -UserPrincipalName OLD_Username@cheapflights.com –NewUserPrincipalName New_Username@cheapflights.com’
3. Force directory synchronization
No Comments