In a Microsoft Office365 migration project, I faced the following error trying to migrate a mailbox from an on-premises Exchange 2013 database to Exchange Online:
Error: MigrationPermanentException: Target user ’Doodle, Johnny’ already has a primary mailbox. –> Target user ’Doodle, Johnny’ already has a primary mailbox.
I was sure I hadn’t migrated Johnny’s mailbox before. So deleting the online mailbox was the best option. However, I couldn’t find his mailbox in Exchange Online.
Solution
To delete a mailbox in this particular situation, you must delete the user from Office365 / Azure AD. To do so, execute the following powershell commands:
Connect-MSOLService Remove-MsolUser –UserPrincipalName johnnydoodle@itexperience.net Remove-MsolUser –UserPrincipalName johnnydoodle@itexperience.net -RemoveFromRecycleBin
After that, I initiated a new sync to Azure AD. Make sure you run this command in a Powershell session with the Azure Active Directory module imported. . Something like
Start-AdSyncSyncCycle Start-Sleep 60 Start-AdSyncSyncCycle
Make sure you run this command in a Powershell session with the Azure Active Directory module imported.
To find out whether the sync has finished, easily re-enter Start-ADSyncSyncCycle. If it returns an error, it’s still busy. If it’s finished, it will run again 🙂
Then, after this sync cycle has completed (often completed within 5 minutes), retry to move the mailbox to Exchange Online.
For your reference, this is the error when you try to run the AD sync while the sync is still busy running:
PS C:\WINDOWS\system32> Start-ADSyncSyncCycle
Result
——
SuccessPS C:\WINDOWS\system32> Start-ADSyncSyncCycle
Start-ADSyncSyncCycle : System.InvalidOperationException: Connector: itexperience.onmicrosoft.com – AAD is busy.
at Microsoft.MetadirectoryServices.Scheduler.Scheduler.StartSyncCycle(String overridePolicy, Boolean
interactiveMode)
at SchedulerUtils.StartSyncCycle(SchedulerUtils* , Char* policyType, Int32 interactiveMode, Char** errorString)
At line:1 char:1
+ Start-ADSyncSyncCycle
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Ident…ADSyncSyncCycle:StartADSyncSyncCycle) [Start-ADSyncSyncCy
cle], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException: Connector: itexperience.onmicrosoft.com – AAD is busy.
at Microsoft.MetadirectoryServices.Scheduler.Scheduler.StartSyncCycle(String overridePolicy, Boolean interactiv
eMode)
at SchedulerUtils.StartSyncCycle(SchedulerUtils* , Char* policyType, Int32 interactiveMode, Char** errorString)
,Microsoft.IdentityManagement.PowerShell.Cmdlet.StartADSyncSyncCycle
Thanks it worked