Recently I came across this error when trying to provision a new mailbox for a user. The user was synced to Azure AD in the past and most probably his mailbox was migrated too. But then as the account was not active, it was deactivated and as the deactived accounts OU was not enabled for sync, the user mailbox got soft deleted and eventually after a month’s grace period got hard deleted. Now that the user was brought to active users OU which was enabled for sync, the mailbox was not getting created depsite assigning the Exchange license.
Error: The user’s on-premises mailbox hasn’t been migrated
The Exchange License was unassigned and re-assigned just to make sure the problem is not coming from there but it did not resolve the issue.
Exchange License Assigned
While searching online I came across a few posts referring to the AD attributes particularly the msexchmailboxguid attribute. In the presence of this attribute Exchange Online thinks that the user has already a mailbox in the Exchange On-Premise so it does not create a fresh mailbox.
msexchmailboxguid Attribute
In order to create a fresh mailbox we need to clear this attribute. Once the attribute is cleared and user re-synced, Exchange Online provisions a new mailbox for the user. I do not remember exactly if it is absolutely necessary to clear the following other attributes as well but in my case I cleared the following as well:
msExchRecipientDisplayType: -2147483642
msExchRecipientTypeDetails: 2147483648
msExchRemoteRecipientType: 4