"You must specify the PrimaryOnly parameter" error when you try to move a primary mailbox to Exchange Online in a hybrid deployment

Applies to: Exchange OnlineExchange Server 2016 Enterprise EditionExchange Server 2016 Standard Edition

Note The Hybrid Configuration wizard that's included in the Exchange Management Console in Microsoft Exchange Server 2010 is no longer supported. Therefore, you should no longer use the old Hybrid Configuration wizard. Instead, use the Office 365 Hybrid Configuration wizard that's available at http://aka.ms/HybridWizard. For more information, see Office 365 Hybrid Configuration wizard for Exchange 2010.


You have a hybrid deployment of on-premises Exchange Server and Exchange Online in Office 365 in which primary mailboxes are located in the on-premises environment and archive mailboxes are located in Exchange Online. When you try to move only a primary mailbox from the on-premises environment to Exchange Online by using the Exchange admin center in Office 365, you receive the following error message. 
Error: MigrationPermanentException: You must specify the PrimaryOnly parameter


The Exchange admin center doesn't have the option to move only a primary mailbox. To do this, you must use the New-MoveRequest cmdlet.


To move only a primary mailbox, follow these steps:
  1. Connect to Exchange Online by using remote PowerShell. For more information about how to do this, see Connect to Exchange Online using remote PowerShell.
  2. Run the following command:
    New-MoveRequest -Identity <user@contoso.com> -RemoteCredential (Get-Credential) -Remote -RemoteHostName 'on-premises mrsproxy url' -BatchName <Name of Batch> -PrimaryOnly -TargetDeliveryDomain <mail.onmicrosoft.com domain> 
    Note When you're prompted for credentials, enter your on-premises Exchange credentials.
For more information about the New-MoveRequest cmdlet, see New-MoveRequest


You can also use the New-MigrationBatch cmdlet together with the -PrimaryOnly parameter to move only a primary mailbox. For more information, about this cmdlet, see New-MigrationBatch.

Still need help? Go to Microsoft Community or Exchange TechNet Forums.