Removing Orphaned Mailboxes in Exchange Hybrid

I have come across many instances in Exchange Hybrid migrations where some users have an Exchange Online mailbox as well as an Exchange on-premises mailbox. As a result of this, you cannot migrated the on-prem mailbox to Exchange Online.

This issue occurs when a user is licensed for Exchange Online in Office 365 before the hybrid is in place. If AADConnect does not acknowledge that a hybrid is established yet, an Exchange Online mailbox will be provisioned.

Fortunately, there’s a fix for this issue, a command created to clear out the orphaned Exchange Online mailbox, and prepare the user for hybrid migration.

Below are the simplified steps taken to clear this issue:

  1. Remove the Exchange Online license from the user in question.
  2. Run the following command against the user in Office 365 Powershell: set-user [email protected] -PermanentlyClearPreviousMailboxInfo
  3. Force AADConnect to perform a delta sync.
  4. Add the Exchange Online license back to the user in question.

Once complete, the mailbox should state that the user’s on-premises mailbox hasn’t been migrated to Exchange Online: