Fix Exchange Migration Error: Target User Already Has a Primary Mailbox
Question details
The administrator needs to resolve a migration failure caused by an error stating that the target user already has a primary mailbox.

- Product
- Microsoft Exchange
- Device & OS
- not provided
- Scenario
- Migrating a user mailbox from Exchange Online to an on-premises Exchange environment.
- Observed behavior
- The migration fails due to duplicate mailbox objects, stale remote mailbox attributes, or an ExchangeGUID mismatch between the cloud and on-premises directories.
Ensure you have global administrator or Exchange administrator privileges and can connect to both the on-premises Exchange Management Shell and Exchange Online PowerShell.
Identify and Resolve ExchangeGUID Mismatches
Check for conflicting mailbox attributes between your on-premises and Exchange Online environments to fix the duplicate primary mailbox error.
This error is most commonly triggered when Active Directory attributes are out of sync, causing the system to believe a primary mailbox already exists in the target environment. You must verify and align the ExchangeGUID values.
Open your on-premises Exchange Management Shell. Run the command 'Get-RemoteMailbox <user@domain.com> | FL' and 'Get-Recipient <user@domain.com> | FL' to review the current attributes of the affected account.
Connect to Exchange Online PowerShell. Execute the command 'Get-Mailbox <user@domain.com> | FL' to retrieve the mailbox attributes currently registered in the cloud.
Look at the 'ExchangeGUID' from the Exchange Online output and compare it against the remote mailbox object's 'ExchangeGUID' in your on-premises directory. They must match perfectly.
If you identify an active duplicate primary mailbox or mismatched attributes, update the on-premises object to match the cloud GUID. Ensure the remote mailbox points to the intended on-premises database before re-initiating the migration.

Enhance Your Daily Productivity with WPS Office
While server-level Exchange migrations require dedicated Microsoft administration tools, managing your daily documents and communications doesn't have to be complicated. WPS Office provides a free, lightweight, and user-friendly alternative to Microsoft Office, letting you handle documents, spreadsheets, and presentations without heavy subscription fees.
- 1. Download the Suite: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the installer and follow the quick on-screen instructions to set up the software.
- 3. Open Your Office Files: Launch WPS Office to instantly open, edit, and save your existing Microsoft Word, Excel, and PowerPoint files.

Frequently Asked Questions
Why does the 'Target user already has a primary mailbox' error occur?
This error typically happens when there are duplicate mailbox objects, stale remote mailbox attributes, or an ExchangeGUID mismatch between the on-premises Exchange directory and the Exchange Online directory.
How do I find the ExchangeGUID for an online mailbox?
You can find the ExchangeGUID by connecting to Exchange Online PowerShell with your admin credentials and running the command: Get-Mailbox user@domain.com | Format-List ExchangeGUID.
What should I do if the ExchangeGUIDs do not match?
You need to manually update the on-premises remote mailbox object's ExchangeGUID to match the one found in Exchange Online. This ensures the directories synchronize properly and recognize the correct primary mailbox.
Can a recent database move cause this migration error?
Yes. If a user, mailbox, or remote mailbox was recently moved between forests or databases, Active Directory replication might not have fully completed, resulting in conflicting mailbox states during the migration process.




