Moving mailboxes between Exchange 2010 on-prem & Exchange Online for hybrid environments

Migrating Exchange 2010 mailboxes to and from Exchange Online needs to be performed via PowerShell

Connecting to Exchange Online
$UserCredential = Get-Credential (Enter your O365 Global Admin credentials)
$ONPREMCREDS = Get-Credential (Enter your on-prem credentials domain\username)
Create a persistent connection to O365 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Import commands
Import-PSSession $Session

Moving on-prem mailbox to Exchange Online

New-MoveRequest -Identity “UserAlias” -Remote -RemoteHostName -TargetDeliveryDomain -RemoteCredential $ONPREMCREDS -BadItemLimit 1000

Moving Exchange Online mailbox to on-prem
new-moverequest -identity UserAlias -OutBound -RemoteTargetDatabase ‘On-premMailboxDatabase’ -RemoteHostName ‘’ -RemoteCredential $(Get-Credential) TargetDeliveryDomain ‘

Monitoring move requests
Get-MoveRequest | Get-MoveRequestStatistics
Clearing previous move requests
Get-MoveRequest | Remove-MoveRequest

Disconnect PSSession once finished
Remove-PSSession $Session