Offboarding mailbox fails with error: MigrationPermanentException Target user already has a primary mailbox
Article
Applies to:
Exchange Online
Symptoms
Assume that you are in a Microsoft Exchange hybrid environment. When you try to offboard Exchange Online mailboxes to the on-premises organization by using the migration batch in Microsoft 365 Exchange Admin Center (EAC), the attempt fails, and you receive an error message that resembles the following:
'Error: MigrationPermanentException: Target user 'User' already has a primary mailbox.'.
Cause
This issue occurs because the HomeMDB and HomeMTA attributes are present on the user object in on-premises Active Directory, and they contain values.
Resolution
To fix this issue, follow these steps:
Step 1: Install Active Directory PowerShell Module, and then run either of the following PowerShell commands to review the values of the homeMDB and homeMTA attributes on the user object.
Get-ADUser -Identity'SAMAccountName of the user' -properties homemdb,homemta | Set-ADobject -clear homemdb,homemta
Step 3: Select the affected users in the migration batch, and then start the batch to move the users again. In this step, you could also use the following PowerShell command:
Are you looking to move to the cloud and easily migrate to Business Central online? This module covers how you can use the built-in migration tools to migrate data to Business Central online from specific product versions.
If you’re an administrator who deploys and manages Microsoft 365 and performs Microsoft 365 tenant-level implementation and administration of cloud and hybrid environments, this certification is designed for you.