During a Office 365 migration on a Hybrid environment with AAD Connectran in to the following scenario:

  • Hybrid Co-Existence Environment with AAD-Sync
  • User [email protected] has a mailbox on-premises. Jon is represented as a Mail User in the cloud with a office 365 license
  • [email protected] had a cloud only mailbox prior to the initial AD-sync was run
  • User account is registered as a mail-user and has a valid license attached
  • During the office 365 Remote mailbox move we end up with the following error during validation and removing the immutable ID and remapping to on premise account wont fix the issue
Target user 'Sam fisher' already has a primary mailbox.
+ CategoryInfo : InvalidArgument: (tsu:MailboxOrMailUserIdParameter) [New-MoveRequest], RecipientTaskException
+ FullyQualifiedErrorId : [Server=Pl-EX001,RequestId=19e90208-e39d-42bc-bde3-ee0db6375b8a,TimeStamp=11/6/2019 4:10:43 PM] [FailureCategory=Cmdlet-RecipientTaskException] 9418C1E1,Microsoft.Exchange.Management.Migration.MailboxRep
lication.MoveRequest.NewMoveRequest
+ PSComputerName : Pl-ex001.Paladin.org

It turns out this happens due to an unclean cloud object on MSOL, This is because Exchange online keeps pointers that indicate that there used to be a mailbox in the cloud for this user

Option 1 (nuclear option)

to fix this problem was to delete *MSOL User Object* for Sam and re-sync it from on-premises. This would delete [email protected] from the cloud – but it will delete him/her from all workloads, not only Exchange. This is problematic because Sam is already using Teams, One-drive, SharePoint.

Option 2

Clean up only the office 365 mailbox pointer information

PS C:\> Set-User [email protected] -PermanentlyClearPreviousMailboxInfo 
Confirm
Confirm
Are you sure you want to perform this action?
Delete all existing information about user "[email protected]"?. This operation will clear existing values from
Previous home MDB and Previous Mailbox GUID of the user. After deletion, reconnecting to the previous mailbox that
existed in the cloud will not be possible and any content it had will be unrecoverable PERMANENTLY. Do you want to
continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): a

Executing this leaves you with a clean object that can be re-licensed without causing the duplicate-mailbox problem,

in my case the license was reapplied via the group based licensing and i was able to initiate the mailbox move shortly with no issues

 

Hybrid Exchange mailbox On-boarding : Target user already has a primary mailbox – Fix

You May Also Like

One thought on “Hybrid Exchange mailbox On-boarding : Target user already has a primary mailbox – Fix

  1. Ran this command doesn’t seem to work. I ran it then tried forcing a AD Sync. Then kick my migraiton off again. Mailbox doesn’t disapear from Mailbox view in Exchange Online ECP.

Leave a Reply