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
- Move user to other OU
- Force sync in Azure AD connect
- Delete user from recycle bin in Azure AD
- Move user to prevouse OU
- Force sync in Azure AD connect again
- Get GUID in Exchange Management shell
// Get-Mailbox sin@bunthoeurn.com | fl Name,ExchangeGuid // replace with user account - Set GUID to match account in Exchange Online
// Set-MailUser -Identity sin@bunthoeurn.com -ExchangeGUID 3e047eb3-ced8-40d0-96f8-07e820b5782c // replace GUID user account - Synce Force sync in Azure AD connect again
- 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