2019 TurtleDesk All Rights Reserved

Target user '***' already has a primary mailbox.

January 3, 2018

I was working on the issue and while initiating the migration for the user, I was getting below error.


Target user 'XYZ' already has a primary mailbox.

    + CategoryInfo          : InvalidArgument: (XYZ@***.com:MailboxOrMailUserIdParameter) [New-MoveRequest], Rec


    + FullyQualifiedErrorId : [Server=HK2PR0401MB2131,RequestId=fb410f15-947c-4585-b1c4-0a341d76fce9,TimeStamp=1/2/201

   8 2:20:39 PM] [FailureCategory=Cmdlet-RecipientTaskException] 1B6E98D6,Microsoft.Exchange.Management.Migration.Mai



Please follow below steps for resolution:


1. Please run below command in onprem exchange shell.


Get-Mailbox -identity Xyz@***.com


2. Please run below command in Exchange online power shell.


Get-Mailbox  -identity Xyz@***.com


You will be able to see mailbox in both location. It seems when someone was initiated the migration of the mailbox last time was got migrated but the specific AD Attributes was not got changed.


You can follow below blog which will help you out with those attributes detail




3. Now, Please go to ADSI Edit and search for the ID.

Once you will find it, right click on same and go to properties.


In the AD ID properties, Please look for below attributes and change it accordingly.


msExchRecipientTypeDetails : Please set the value to 2147483648


msExchRecipientDisplayType: Please set the value to -2147483642


msExchRemoteRecipientType: Please set the value to 4


target address: Please set the value to xyz@***.onmicrosoft.com/xyz@***.mail.onmicrosoft.com (Depends what routing address you have configured)


mail: Please set the value to UserprincipalName@***.com (e.g. if the user XYZ is having UPN XYZ@***.com


4. Once you will change the AD attributes of the ID, Will take some time in replication.


5. Now again, you will run the command in both the powershell for onpremise and O365, you will be able to get the mailbox in both onpremise and O365.


6. You need to disable the mailbox from onpremise and need to provisioned for O365.


Please use below command to disable from onpremise.

Go to Exchange Management Shell and run below command.

Disable-Mailbox -identity XYZ@***.com


7. Please execute below command to enable mailbox as remote mailbox.


Enable-RemoteMailbox -identity XYZ@***.com -Remoteroutingaddress xyz@***.onmicrosoft.com/xyz@***.mail.onmicrosoft.com (Depends what routing address you have configured)


8. Now, if you execute step 1 & step 2 command in both powershell, you only be able to view in exchange online.




Share on Facebook
Share on Twitter
Please reload

Featured Posts

I was recently working with the customer on ADFS Upgradation from 2.0 - 4.0. This blog post will help you to design parallel infrastructure for ADFS 4...

ADFS 2.0 to 4.0

July 9, 2019

Please reload

Recent Posts

July 9, 2019

Please reload