Office 365 and Exchange Migration Notes

This post is a collection of my recent Windows/Exchange administrative work.

Run AD Directory Sync Manually (New Version of Start-OnlineCoexistenceSync)



Import-Module ADSync
Start-ADSyncSyncCycle -PolicyType Delta


Start-ADSyncSyncCycle -PolicyType Initial

How do I check total mailbox sizes for Office 365/Exchange Online mailboxes?



# In PowerShell:
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection 
Import-PSSession $Session

get-mailbox | get-mailboxstatistics | ft displayname, totalitemsize 

# When done:
Remove-PSSession $Session

Error during migration: MigrationPermanentException: Cannot find a recipient that has mailbox GUID ” error message when you try to move a mailbox in an Exchange hybrid deployment


  • Ensure the local user object doesn’t have an exchange GUID. From the local Exchange Management Shell:
    Get-RemoteMailbox <MailboxName> | Format-List ExchangeGUID
  • Get the GUID from the error message, or retrieve it from the O365/Exchange Online shell (connect as above):
    Get-Mailbox <MailboxName> | Format-List ExchangeGUID
  • Set the exchange GUID for the user from the local Exchange Management Shell:
    Set-RemoteMailbox <MailboxName> -ExchangeGUID <ExchangeGUID>
  • Force directory sync. Using the latest Azure AD Connect commands, on the server with the directory sync tool installed:
    Import-Module ADSync
    Start-ADSyncSyncCycle -PolicyType Delta
  • Monitor with “Azure AD Connect Synchronization Service Manager” GUI application if needed.


Error during migration:  MigrationPermanentException: Mailbox size 12.56 GB ‎(13,489,367,463 bytes)‎ exceeds target quota 2.3 GB ‎(2,469,396,480 bytes)‎.


  • If applicable to a single user, use ADSI Edit to set the “mDBUseDefaults” property to False on the applicable user object, then try again.
  • If database or organization-wide, use the Exchange Administrative Center to remove quotas for the database.

I have a migration batch that partially failed. Now I can’t get those mailboxes to migrate.


Scenario: A migration batch was partially successful (one or more mailboxes in the batch migrated properly). The errors for the remaining mailboxes have been corrected. I’d like to start a new migration batch containing the failed mailboxes, but the batch bombs out with an email to the Exchange Online administrator. The batch online looks like it’s still migrating, but the CSV with the results that was emailed contains the following error messages for each account:

The user "" is already included in migration batch "My Migration Batch Name."  Please remove the user from any other batch and try again.

In this case you need to remove user from migration batch using the Remove-MigrationUser cmdlet when connected to the Exchange Online PowerShell session:

  • Get the details of all users in migration batches, or get the details for the specific user being migrated:
  • Remove the user from the migration batch. Use the additional -Force parameter if you aren’t running interactively.
  • Clean up any migration batches that may still be in progress with the ‘already included’ error.
  • Create a new migration batch containing the affected mailboxes.