Fix it now
The move refuses to start because the object it is meant to fill already looks like a mailbox. Microsoft’s documented cause for the offboarding case is stale HomeMDB and HomeMTA attributes on the on-premises Active Directory user; the other common cause is a licence that provisioned a cloud mailbox before the move ran. Check the attributes first, because it takes one command.
Get-ADUser -Identity <SamAccountName> -Properties homemdb,homemta
Get-ADUser -Identity <SamAccountName> -Properties homemdb,homemta | Set-ADObject -Clear homemdb,homemta
Start-MigrationUser -Identity user@contoso.com
- Read the first command’s output before running the second. If
homemdbandhomemtaare already empty, this is not your cause and clearing them changes nothing. - Check what the target object actually is:
Get-Recipient user@contoso.com | Format-List RecipientType,RecipientTypeDetails,PrimarySmtpAddress. A user mailbox where you expected a mail user is the licence case, not the attribute case. - Look for a leftover request holding the pair:
Get-MoveRequest -Identity user@contoso.comandGet-MigrationUser -Identity user@contoso.com. Remove what belongs to an abandoned attempt. - Re-check the recipient type, then restart the affected users rather than rebuilding the whole batch.
Deleting mailboxes to clear a stuck move destroys mail. Confirm which copy holds the live data before you remove anything, and never remove the source mailbox to make an error message go away.
If the move now reaches an in-progress status, you are done. If it still refuses, the next section explains what the two objects are supposed to look like at each stage.
Why it happens
A remote move is a swap of roles as much as a copy of data. Before it runs, the source organisation holds the real mailbox and the target holds a mail-enabled user that forwards to it. When the move completes those roles reverse: the target becomes the real mailbox and the source object becomes a mail-enabled or remote mailbox pointing at the new home. Both sides are edited as part of completion, and both sides can be left half-edited.
What the replication service checks is whether the destination object already claims to hold a primary mailbox. On premises that claim is carried by attributes rather than by a mailbox that exists: HomeMDB names the database a mailbox lives in and HomeMTA names its message transfer agent. A user object that was mailbox-enabled at some point in its history, or that a migration tool wrote to, can carry both long after the mailbox itself has gone. To the move, that object is occupied.
In the other direction the claim is real. If someone assigns a mailbox-bearing licence to the cloud account before the move, the service provisions an actual cloud mailbox on an object that was supposed to remain a mail user, and the move arrives to find the seat taken. Either way the service refuses rather than merging two mailboxes, which is the correct behaviour and the reason the exception is permanent.
HomeMDB and HomeMTA are still populated on the on-premises object
You have this one if Offboarding a mailbox from Exchange Online, and the message reads “Target user ‘name’ already has a primary mailbox”.
- Read the values:
Get-ADUser -Filter {userprincipalname -eq 'user@contoso.com'} -Properties homemdb,homemta. - Clear them:
Get-ADUser -Filter {userprincipalname -eq 'user@contoso.com'} -Properties homemdb,homemta | Set-ADObject -Clear homemdb,homemta. - Restart the affected users in the batch, or run
Start-MigrationUser -Identity user@contoso.com.
This is the cause Microsoft documents for the offboarding case, and it is the cheapest to test. Do it before you go anywhere near a mailbox.
A licence provisioned a mailbox on the target before the move
You have this one if The target object reports a user mailbox, the mailbox is empty or nearly so, and the account was licensed days before the batch ran.
- Confirm the mailbox is genuinely empty by checking item counts, not just the creation date.
- Remove the service plan that provides the mailbox from that account so the mailbox is deprovisioned.
- Wait for the change to take effect and for directory synchronisation to re-apply the mail user attributes from on premises.
- Confirm the recipient type is a mail user again, then create the move request.
The clean sequence for a hybrid move is to license the account after the mailbox has landed, not before. Put that order in the runbook and it stops happening.
A previous attempt left move state on the directory object
You have this one if No move request is listed on either side, but the error persists and nothing you change makes any difference.
- Turn on Advanced Features in Active Directory Users and Computers and open the Attribute Editor for the user.
- Look for
msExchMailboxMoveRemoteHostName,msExchMailboxMoveSourceMDBLink,msExchMailboxMoveTargetMDBLinkand the two archive equivalents. - Record the values, then clear them.
- Create a new move request for the user rather than resuming the old one.
Back up what you clear. These are read by the service you are trying to unstick, and an incorrect Active Directory edit is not something you can undo from memory.
A soft deleted mailbox still occupies the address
You have this one if The target looks correct, but creating the request fails because the address or the mailbox identity is already in use.
- Search for it:
Get-Mailbox -SoftDeletedMailbox -Identity user@contoso.com | Format-List Name,ExchangeGuid,WhenSoftDeleted. - If it is the mailbox you actually want, restore it rather than moving a second one into place.
- If it is a genuine duplicate with nothing you need, remove it permanently and wait for the change to settle before retrying.
Removing a soft deleted mailbox is irreversible and ends the recovery window early. Confirm the contents first.
An orphaned store mailbox is left on the source database
You have this one if On premises the directory object looks correct, but the store still lists a disconnected mailbox for that person on the old database.
- List them:
Get-MailboxStatistics -Database <db> | Where-Object {$_.DisconnectReason -ne $null} | Format-Table DisplayName,MailboxGuid,DisconnectReason. - Match the mailbox identifier against the directory object so you are certain which one you are looking at.
- Remove the orphan, quoting its identifier and disconnected state, then retry the move once the store and the directory agree.
That removal is permanent and bypasses the usual recycle behaviour. Take a backup of the database first if the data has any value at all.
Full reference
What each object should look like, and when
| Stage | Source organisation | Target organisation |
|---|---|---|
| Before an onboarding move | User mailbox | Mail user, or a mail-enabled user created by directory sync |
| After it completes | Remote or mail-enabled user pointing at the new home | User mailbox |
| Before an offboarding move | User mailbox in Exchange Online | Remote mailbox on premises, HomeMDB and HomeMTA empty |
| A half-finished attempt | Mailbox | Mailbox as well, which is what the exception is objecting to |
| A licence applied too early | Mail user | User mailbox that nobody asked for, usually empty |
Reading the target before you change anything
| What you find | What it tells you |
|---|---|
homemdb and homemta carry values on premises |
The documented offboarding cause; clear them |
| The target reports a user mailbox instead of a mail user | A mailbox was provisioned there, usually by an early licence |
| Both source and target report a mailbox | An earlier attempt converted one side and failed before finishing |
| A move request exists with a failed or completed status | Stale state; remove it before creating anything new |
| The target has no mail user at all | Directory synchronisation has not created it, or filtering excludes the object |
| The address is held by a soft deleted mailbox | A previous mailbox is still occupying it inside the recycle window |
Restarting without rebuilding
Once the state is repaired you do not need a new batch. Start-MigrationUser -Identity user@contoso.com restarts one user, and the equivalent in the admin centre is selecting the affected users inside the existing batch and starting them again. Rebuilding the batch discards the progress of every user who was already synced, which on a large batch is a day you will not get back.
Order of operations that stops this happening
- Create or synchronise the target object and confirm it is a mail user, not a mailbox.
- Run the move and let it complete.
- Assign the licence after the mailbox has landed.
- Confirm the source object has converted to a remote or mail-enabled user pointing at the new home.
- Only then remove the migration batch and tidy up.
When several users in a batch fail and the rest do not
- Look for what those accounts have in common rather than what is wrong with the batch. It is almost always an order-of-operations problem applied to some accounts and not others.
- Accounts that were licensed early are the usual group.
- Accounts included in an earlier failed attempt are the second group.
- Accounts that were once mailbox-enabled on premises years ago are the third, and they are the ones carrying HomeMDB.
- The rest of the batch never entered the broken state and does not need touching.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
TargetUserAlreadyHasPrimaryMailboxException |
The target object already holds a primary mailbox, so the move has nowhere to land. Microsoft’s documented cause for offboarding is HomeMDB and HomeMTA carrying values on the on-premises user | Microsoft Learn |
SourceMailboxAlreadyBeingMovedTransientException |
Another request already holds the source mailbox. Microsoft documents the equivalent conditions as UserAlreadyBeingMigratedException and an ‘already being moved’ permanent exception | not published by the vendor |
MailboxReplicationTransientException |
A replication fault the service expects to clear on retry | not published by the vendor |
MailboxReplicationPermanentException |
A replication fault the service will not retry, requiring a state or configuration change first | not published by the vendor |
TimeoutErrorTransientException |
An operation exceeded its time allowance, commonly a slow store or a saturated link | not published by the vendor |
RemotePermanentException |
The remote organisation reported a fault that will not resolve without intervention | not published by the vendor |
Confirm the fix worked
Get-ADUser -Properties homemdb,homemtareturns empty values for the affected user.Get-Recipientagainst the target reports the recipient type the move expects.- No move request or migration user remains for that person on either side.
- The restarted move reaches an in-progress status rather than failing on validation.
- After completion the source object points at the new mailbox location and mail routes correctly in both directions.
Questions people ask about this
Does this cost anything to fix?
No. Everything here is directory and mailbox state you already control, and no purchase changes the outcome. The usual trigger is a licence applied at the wrong moment rather than a missing one.
Is clearing HomeMDB and HomeMTA safe?
On an object that is supposed to be a remote mailbox in a hybrid deployment, yes, and Microsoft documents it as the fix. Record the values first, and do not clear them on a user who genuinely has an on-premises mailbox you still want.
Can I just delete the target mailbox and start again?
Only after proving it is empty. If the mailbox on the target holds real content, deleting it loses that content and the move will not merge the two. Compare item counts on both sides first.
How long after removing a licence can I retry?
Give the change time to propagate through the service and through directory synchronisation before you judge it. Retrying immediately usually reports the state you just changed.
Why did only a few users in the batch fail?
Because only those accounts were touched out of order: licensed early, included in an earlier failed attempt, or carrying attributes from a mailbox they had years ago. The rest never entered the broken state.
