Summary


An account in active directory has had its email address changed from one federated domain to another, however this isn't showing up in Office 365.




Cause


For the purpose of this solution, the following examples will be used.


An Office 365 tenancy has these federated domains:


example.co.uk

anotherdomain.com

example.onmicrosoft.com


Office 365 doesn't support the automatic rename of one federated domain to another when using AD synchronisation. It has to be done using PowerShell.




Solution


Use the Office 365 (MSOnline) Powershell modules which can be downloaded from here. The email address has to be changed to the onmicrosoft.com address first and then to the required federated one.


Once installed, the commands needed are:


connect-msolservice (enter global admin credentials)


Set-MsolUserPrincipalName -UserPrincipalName example@example.co.uk -NewUserPrincipalName example@example.onmicrosoft.com


Once this has been changed run:


Set-MsolUserPrincipalName -UserPrincipalName example@example.onmicrosoft.com -NewUserPrincipalName example@anotherdomain.com


And the change will now be visible in Office 365.