This user’s on-premises mailbox hasn’t been migrated to Exchange Online

When you create a new user in on-premise active directory and sync to Entra ID using Entra connect, you might get below error message on Microsoft 365 admin center.

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 issue occurs when msExchMailboxGuid is set for the user object in active directory. Therefore, Exchange online will report that this mailbox has not been migrated to Exchange online yet and therefore won’t provision a mailbox for the user.

The Exchange Online mailbox will be available after migration is completed

How I Fixed this Issue

To fix this issue, we need to clear a few attributes for a user object in active directory. We will clear msExchMailboxGuid, msExchRecipientDisplayType and msExchRecipientTypeDetails and run the entra sync.

  1. Login to a domain controller and open AD users and computers (dsa.msc).
  2. Search for the affected user > right-click on it > Properties > Attribute Editor.
  3. Find msExchMailboxGuid in the list of attributes and double-click on it.
  4. Click on Clear to delete the value of this attribute. Click OK to save.
msExchMailboxGuid
  1. Find msExchRecipientDisplayType attribute and Clear its value. Click OK to save.
msExchRecipientDisplayType 
  1. Find msExchRecipientTypeDetails attribute and Clear its value. Click OK to save.
msExchRecipientTypeDetails 

Delete the User from M365 and Re-sync from On-Prem

Now that we have cleared a few attributes for a user account in on-prem active directory. We will delete the user from Microsoft 365. For this, move the user account to an OU which is not getting synced with Entra ID (an OU which is excluded from sync in Entra connect) and then run a delta sync.

Initiate Delta Sync with Entra ID

Start-ADSyncSyncCycle -PolicyType delta
Start-ADSyncSyncCycle -PolicyType delta
  • After the delta sync is complete, in a couple of minutes you will find that the user is now deleted and moved to Deleted Users on Microsoft 365 admin center.
  • To check the deleted users on Microsoft 365 Admin center. Go to Users > Deleted Users.

Permanently Delete Microsoft 365 User

When a user is moved to Deleted users on Microsoft 365 admin center, it will remain in Deleted Users for 30 days, before it gets permanently removed. We want to permanently delete the user account sooner than 30 days.

There are many ways to force delete a user account. You can use Entra admin center or graph PowerShell commands. I will provide the commands below. For a complete guide on how to delete a user permanently from Microsoft 365, refer to the link: Permanently Delete Users from Microsoft 365.

  • Open PowerShell console as an administrator and execute below commands.

# Install Microsoft Graph module

Install-Module Microsoft.Graph -Scope CurrentUser

# Import Microsoft Graph module

Import-Module Microsoft.Graph

# Connect to Microsoft Graph with required permissions

Connect-MgGraph -Scopes "User.ReadWrite.All" -NoWelcome

# Get the list of deleted users Including DirectoryObjectId

Get-MgDirectoryDeletedItemAsUser

# Delete a specific deleted user object

Remove-MgDirectoryDeletedItem -DirectoryObjectId 2ba20d9c-6784-4cc4-bdb3-a4a7ef8c2ac1

Confirm if the user is Permanently deleted

Get-MgDirectoryDeletedItemAsUser
  • Once the user is permanently removed from Microsoft 365. We will re-sync the user by moving the user to an OU which is getting synced with Entra ID. After that, execute below command to start the delta sync.

Initiate delta sync

Start-ADSyncSyncCycle -PolicyType delta
  • Once the delta sync is completed successfully, the User account will be created on Microsoft 365 admin center. Assign a M365 license to the user, A mailbox for this user will be created successfully this time.

Read Next

Leave a Comment