Fixing for existing(already exist)

Fixing for existing(already exist)

Fixing for existing(already exist) user than cant migrate (MigrationPermanentException: Target user ‎’bunthoeurn sin‎‎’ already has a primary mailbox. –> Target user ‎’bunthoeurn sin‎’ already has a primary mailbox.)

Get-MailUser -Identity sin@bunthoeurn | fl displayname,ExchangeGuid

  1. Move user to other OU
  2. Force sync in Azure AD connect
  3. Delete user from recycle bin in Azure AD
  4. Move user to prevouse OU
  5. Force sync in Azure AD connect again
  6. Get GUID in Exchange Management shell
    // Get-Mailbox sin@bunthoeurn.com‎ | fl Name,ExchangeGuid // replace with user account
  7. Set GUID to match account in Exchange Online
    // Set-MailUser -Identity sin@bunthoeurn.com‎ -ExchangeGUID 3e047eb3-ced8-40d0-96f8-07e820b5782c // replace GUID user account
  8. Synce Force sync in Azure AD connect again
  9. Migrat user as normal

Connect to exchange online
Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

////////////////////////////////////////////////////////////////////////////
Import-PSSession $Session -DisableNameChecking

Leave a Reply

Your email address will not be published.