In a recent project I performed a staged migration from Exchange 2003 to Office 365. There were several users whose names changed over the years due to marriages. Their pre-Windows 2000 AD logon name was changed as well to reflect their new name. However, these dirsynced users were getting an Office 365 user name based on their old name from a non-updated userPrincipalName in AD.
For example, here's what Mary Smith's user account looks like in Active Directory:
|UPN is unchanged from Mary Osgood|
Mary has been logging in as contoso\mary.smith ever since she got married and her account was changed. However, when DirSync was run Mary's account in Office 365 was set to the UPN, email@example.com.
You can change the UPN in AD, but it will not update the user name in Office 365 when DirSync runs. The Office 365 username is configured once during the initial sync and will not be updated. The only way to change it is by using Windows Azure Active Directory Module for Windows PowerShell.
Login to Windows Azure Active Directory Module for Windows PowerShell with Office 365 administrator credentials and run the following command:
Set-MsolUserPrincipalName -UserPrincipalName firstname.lastname@example.org -NewUserPrincipalName email@example.comThis cmdlet will change the Office 365 user name from firstname.lastname@example.org to email@example.com. You can change the UPN to any valid domain.