Skip Navigation LinksMovetoCloudPowerShell

Logo.jpg How to move mailbox in hybrid configuration from Exchange Server to cloud Exchange online with Windows PowerShell

 

To connect to Exchange Online Windows PowerShell use Office 365 Company Administrator credentials, run the command bellow:

 

$LiveCred = Get-Credential

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

Import-PSSession $Session 

 image001.jpg


 

$OnPremisesCreds = Get-Credential

  •  Type the credentials  with format below Dominio\Admin
     image002.jpg

 

New-MoveRequest -identity MoveAlias -Remote -RemoteHostName 'mail.domain.com' -TargetDeliveryDomain ‘Tenant.mail.onmicrosoft.com' -Remotecredential $OnPremisesCreds -BadItemLimit 50 -Verbose

 

MovePS.JPG 

To see the all move request properties in the organization run:

Get-MoveRequest |  Get-MoveRequestStatistics | Select-Object DisplayName, StatusDetail, PercentComplete, OverallDuration, *TimeStamp*, Total


 

To see a specific move request, run the comannd:

Get-MoveRequest user@example.com |  Get-MoveRequestStatistics | Select-Object DisplayName, StatusDetail, PercentComplete, OverallDuration, *TimeStamp*, Total


 

Additioanl commands:

95% Move Error: MoveRequestStatistics: : Transient error StorageTransientException has occurred. The system will retry. Fatal error JobStuckPermanentException

 

Execute the move request with the BadItemLimit 1000 and -SkipMovingFolderRestrictions,FolderViews parameters:

 

New-MoveRequest –Identity MoveRequestName –TargetDatabse –BadItemLimit 1000 –AcceptLargeDataLoss –SkipMovingFolderRestrictions, FolderViews –Debug -Verbose​



Get-MailboxStatistics user@domain.com –IncludeMoveHistory | Select -ExpandProperty MoveHistory
 
Get-Mailbox | Get-MailboxStatistics -IncludeMoveHistory | Select DisplayName, MoveHistory | Export-Csv MoveHistory.csv
 
Get-MailboxStatistics -Identity user@domain.com –IncludeMoveHistory | FL​​


 

Get-MoveRequest -Identity MoveRequestID |Get-MoveRequestStatistics -IncludeReport

Get-moverequest user1@example.com | Get-MoveRequestStatistics |FL

Get-MailboxStatistics user1@example.com -IncludeMoveHistory | FL

To see move request status:

Get-MoveRequest -MoveStatus Failed

Get-MoveRequest -MoveStatus Completewithwarnings

Get-MoveRequest –MoveStatus Completed

Get-MoveRequest –MoveStatus Queued

Get-MoveRequest –MoveStatus AutoSuspended


 

To restart the move request when is suspended, using Office 365 PowerShell with Global Admin credentials, run the command below:

 

Resume-MoveRequest "Move 1"


 


 

This example resumes any "Automatically Suspended" move requests.

 

Get-MoveRequest -MoveStatus "Automatically Suspended" | Resume-MoveRequest

 

This example resumes any failed move requests.

Get-MoveRequest -MoveStatus Failed | Resume-MoveRequest

 

This example resumes any move requests that have the suspend comment "Resume after 10 P.M."

Get-MoveRequest -MoveStatus "Automatically Suspended" | Get-MoveRequestStatistics |Where {$_.Message -like "*resume after 10 P.M.*"} | Resume-MoveRequest


 

Complete or Resume a Move Request

http://technet.microsoft.com/en-US/library/ee364751(v=exchg.141).aspx 

​