Scenario: We migrated (offboarded) a mailbox from Exchange Online to Exchange On-Premises. Although the mailbox was successfully migrated to On-Premises, the Exchange Online mailbox (which should have been deprovisioned) was still available in the cloud with the following error found in the Users:
Exchange: Failed to disable the mailbox <GUID> due to a conflict in directory settings. To disable this mailbox, first run Enable-RemoteMailbox on-premises. After the next Dirsync sync cycle, run Disable-RemoteMailbox on-premises to disable this mailbox in the datacenter.; Exchange: An unknown error has occurred.
The issue is that we cannot Enable-RemoteMailbox On-Premises because a Mailbox already exists for the user account On-Premises. Also we already disabled the Exchange Online license for that account. Its just not working, MICROSOFT!
Instead we got around the issue by doing this:
Solution: In ADSIEdit, we cleared the value for msExchRemoteRecipientType. Originally this value was set to a ‘8’ (DeprovisionMailbox ). By clearing this value, the mailbox and the error are no longer present in Exchange Online and everything is good. There had to be an error in the process of the sync or the mailbox conversion, but after clearing the error there are no issues with the mailbox.