You modify a user’s UPN in Exchange online or AD and the attributes don’t sync to O365 properly or the UPN change is reflected in the O365 portal but not in Exchange Online.
You may also find that the O365 portal gives an error that there is a GUID mismatch of the users archive and the mailbox permissions shows in ‘preparing mailbox’ state.
The above occurs because the mailbox properties did not synchronise properly and will need to be attached to the mailbox again. In this instance, it’s the users archive, a new one has been created as during the new UPN add it got disassociated from the mailbox and needs to be reattached.
So the below command is run to associate the right Archive GUID which can be determined from below or just by clicking on the user name in O365 you should see an error revealing both the new and old Archive GUIDS.
get-remotemailbox email@example.com |Set-RemoteMailbox -ArchiveGuid <the previous Archive guid goes here>