Issue Description
When a new user is added to the on-premises Active Directory, synced to Entra ID, and assigned a license, you might see an error: “This user’s on-premises mailbox hasn’t been migrated to Exchange Online. The Exchange Online mailbox will be available after migration is completed.
This error indicates a mismatch between on-premises and Exchange Online. To fix it, investigate the synchronization process and ensure the user’s mailbox is correctly configured in both environments.
Solution:
- Login on the domain controller and Open Active Directory Users and Computers.
- Search for the affected user and double-click on it to manage Users Attributes.
- Remove
msExchMailboxGuid
attribute value from the On Premise Active Directory User.
- Remove
msExchRecipientDisplayType
attribute value.
- Remove
msExchRecipientTypeDetails
attribute value.
- Move the user to an OU in Active Directory which is not getting synced to Azure Active Directory and run Delta Sync.
Start-ADSyncSyncCycle -PolicyType delta
- After the delta sync is complete, in couple of minutes you will see that the user is now deleted on Microsoft 365 admin center.
- Go to Microsoft 365 Admin center -> Users -> Deleted Users. This is the Recycle Bin where you can find the deleted users.
- Now, Delete this user from Recycle bin by following below steps:
- Open Powershell console as administrator
- Execute following coommands.
Install-module MSOnline
- Run Connect-MSolService command.
Connect-msolservice
- Check the users in Deleted Users. Find the userprincipal name of the user you want to permanently remove from M365.
get-msoluser -ReturnDeletedUsers
- Use below command to delete the user from Recycle bin.
Remove-MsolUser -UserPrincipalName [email protected] -RemoveFromRecycleBin
- Now, Move the user back to the OU which is getting synced to M365 and run delta sync again
Start-ADSyncSyncCycle -PolicyType delta
- After the delta sync completes. Please check the user on Microsoft 365. Assign a license to the user again to create the mailbox. This time it should create the mailbox successfully.