During a recent move from on-premise Exchange to Office 365, I ran into an issue with enabling an Exchange online mailbox via Powershell for a user that already existed within on premise AD.
ExchangeGuid is mandatory on UserMailbox.
Database is mandatory on UserMailbox.
After troubleshooting the issue, I found that the users existing on premise attributes relating to on old/existing mailbox settings was causing a conflict.
To remove the conflicting attributes, I opened up ADSI edit (Warning: Be careful with ADSI edit!), expanded Default Naming Content > DC=ABCCOMPANY,DC=COM,DC=AU, then located the user account in question – email@example.com, right-clicked the user and chose Properties.
Then, from within the properties dialog box, find any entry beginning with msExh, and clear the currently entered value by clicking the Clear button.
You’ll need to perform a DIRSYNC up to Office 365 to sync up the changes. Once done, re-run Enable-RemoteMailbox.
Thanks Craig! Been fighting with this for a couple of days. Your article steered me in the right direction. Awesome work.
Right on the money. Cleared all existing msExch attributes on the on-prem user; Did an AAD Connect Delta Sync cycle; was able to then issue the Enable-RemoteMailbox w/o issue.
Great! Glad I could help Steven
THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!