Offboarding and Onboarding Mailboxes

Offboarding and Onboarding mailboxes to/from Office365
Moving mailboxes 2-way can be done using the EAC from Office365. You may also connect Powershell to Office365 and run any of the scripts below:

Onboarding to Cloud:
$opcred = get-credential [domain\admin]
Get-Mailbox xx| New-MoveRequest -Remote -RemoteHostName 'mail.domain.com' -RemoteCredential $opcred -TargetDeliveryDomain 'o365.mail.onmicrosoft.com'

Offboarding from the Cloud to OnPrem:
$opcred = get-credential [domain\admin]
Get-Mailbox xx| New-MoveRequest -OutBound -RemoteTargetDatabase 'Mailbox Database xxxxxxxx' -RemoteHostName 'mail.domain.com' -RemoteCredential $opcred -TargetDeliveryDomain 'domain name'