Had a request to change the UPN from one Federated Domain to another today and it gave me a bit of trouble.  I made all the appropriate changes in AD thinking it would be that simple, but alas I began getting the following error on my DirSync to O365:

Unable to update this object in Azure Active Directory, because the attribute [FederatedUser.UserPrincipalName], is not valid. Update the value in your local directory services.

Looking at the synchronization service I got the same error with the error number of 105 (I was really hoping for more information).  I did some digging on the internet and came across this article that contained the answer to my problem.

Turns out that when switching a local AD account from one federated domain to another, Azure AD/O365 doesn’t like that too much and doesn’t make the change for you.  Lame.  So I used the following bit of PowerShell to resolve that:

Then kick off a Full Sync on your DirSync box, let it finish, and you’re good to go.