How to Use PowerShell to Perform a Staged Exchange Migration to Office 365?

Staged Exchange Migration to Office 365

Ashish Ratan Singh | Modified: May 29, 2020 | Migration, Office 365 | 7 Minutes Reading

MS Office suite has a web-based version for dynamic applications, i.e. MS Office 365. As a part of Office 365 deployment, users can migrate their mailboxes data to Office 365 from source email system. When this is done for more than relevant time, it is known as staged migration. It is mainly recommended when the source mail system is Exchange Server 2003 or 2007. It is even used when user is having more than 2,000 mailboxes. In the following section, we will discuss the method to use Powershell to perform a staged Exchange migration to Office 365.


For the utilization of Exchange Online Powershell cmdlets, there is a need to sign in and import cmdlets on PowerShell session of Windows.
User need fulfill certain prerequisites before starting this migration. Know what you need to know about a staged email migration to Office 365.

Procedure to Perform Staged Exchange Migration to Office 365

There are some steps involved that helps users to perform staged migration by using Powershell as mentioned.

Step 1: Prepare for Migration

Before starting the migration of mailboxes, users first need to have few changes to Exchange environment.

    • Configure Outlook on-premises Server:
      The migration service utilizes Outlook anywhere for connection with on-premises Exchange Server, which is also known as RPC over HTTP.
      Note: User can utilize a certificate issued by trusted CA (certification authority) with configuration of anywhere Outlook. It cannot be configured with a certificate of self-signed.
    • Verification:
      User can try any of the mentioned way for checking the configuration settings by using Outlook anywhere.
      1. Utilize Outlook from outside the cooperate network for connection with on-premises mailbox of Exchange.
      2. MS Exchange Remote Connectivity Analyzer can be used for verifying the proper settings of connections.
      3. Run the mentioned command on Exchange Online Powershell.


    • Set Permissions:
      The on-premises account that is used for the connection with on-premises Exchange organization must have the essential permissions for utilization of on-premises mailboxes for migration to Office 365. This account is utilized when user needs to connect to email system for creating migration endpoint. For the migration of mailboxes, admin must have any of the mentioned permission sets:
      1. In on-premises organization, in the Active Directory be a member of Domain Admins group.
      2. Assign full permission to access for each on-premises mailbox and permission of WriteProperty for modifying the property of TargetAddress on the user account.
      3. Allot permission of Receive As on mailbox database, which saves user’s mailbox and permission to WriteProperty for modification of property of TargetAddress on user accounts.
    • Disable UM (Unified Messaging):
      If Unified Messaging is enables for migrating mailboxes then, before starting the process of migration turn off UM. Once the migration is completed then, turn on the Unified Messaging.
    • Make New Users by using Directory Synchronization:
      Directory synchronization is used for creating the whole users of on-premises in organization of Office 365. After creating, users need to license; they have thirty days for the addition of license after creating. They can even use MS Azure Active Directory Synchronization Tool or service for creation and synchronization of on-premises users in Office 365. After mailbox migration, user can manage it on-premises organization and synchronize it on organization of Office 365.

Step 2: Create CSV File
After identifying users for On-Premise Exchange to Exchange Online Migration, they can use CSV file for the creation of batch migration. Each row of CSV file is used to run migration by Office 365 that contains the info related to on-premises mailbox. For the staged migration of CSV file, three attributes are supported, i.e. EmailAddress, Password, and ForceChangePassword.
1. Unlimited mailboxes can be migrated to Office 365.
2. CSV file contains 2,000 rows, for the migration more than 2,000 mailboxes additional CSV file creation is required and utilizes new batch migration for utilization of each file.

Step 3: Generate Endpoint of Migration
For successful migration to Office 365, proper communication as well as connection is required with email system. To perform this, Office 365 utilizes migration endpoint. It can be created by using Powershell for that firstly; Connection with Exchange Online is required. User can run the mentioned command for the creation of endpoint known as StageEndpoint:


Note: New-MigrationEndpoint cmdlet is utilized for specification of database service for utilization by using an option of TargetDatabase. Otherwise, it will be directed from services of Active Directory Federation, where it is located.

For Verification run the following command:

Step 4: Produce and Begin Batch Stage Migration

User can utilize cmdlet New-MigrationBatch in Exchange Powershell for creation of batch migration for cutover migration. They can make a migration batch and begin it automatically that includes AutoStart parameter. Otherwise, it can be created and started manually after utilizing cmdlet Start-MigrationBatch.

For Verification run the following command:

To verify if the batch has started, you can use the following command:

Step 5: Convert to Mail-Enabled Users

Once there is, a successful batch migration of mailboxes now, users must require some way that helps them in getting their mails. They have their mailbox on both on-premises and Office 365. Users who have mailbox in Office 365 will not receive new email in their mailbox of on-premises due to reason, as they are not done with migration. When they change from mailbox to a mail-enabled, they can direct to Office 365 for their email instead of going to their on-premises mailbox.

Other reason for conversion mailboxes on-premises to mail-enabled users to preserve the proxy addresses from Office 365 mailboxes by creating the replica proxy of addresses for mail-enabled users. It helps in the management of users of cloud –based by using Active Directory.

Step 6: Deletion of Staged Migration

After converting mailboxes of on-premises in batch to mail-enables users, they can delete batch-staged migration. Before that make a confirmation that the mail is being forwarded to Office 365 mailboxes in batch migration. When they delete staged migration in batch, the service clear all the records related to batch migration. They can use the mentioned command on Powershell perform deletion.


It can be verified by running the following command about IMAPBatch1


The cmdlet either will return the status of removing of batch migration or will give an error.

Step 7: Allot License

Assign the licenses to activate user accounts of Office 365 for the migrated accounts. If the license is not permitted then, mailbox is disabled after the thirty days of grace period.

Step 8: Complete task of Post-Migration

  • Create DNS Autodiscover Record:
    After on-premises mailboxes are migrated to Office 365, user can configure autodiscover record of DNS. It permits them to have connection easily to their new account via Outlook or mobile clients. It uses same namespace, which is used for organization of Office 365. It uses CNAME record for implementation of service of Autodiscover for Outlook and mobile. It must contain following information:
    1. Alias
    2. Target
  • Decommission on-premises Servers:
    After the verification of routed emails to Office 365 mailboxes then, users can uninstall Exchange from servers and remove on-premises of Exchange organization.

Alternative Solution for Migration (Recommended by Tech Experts)

It is pretty clear from the above method that the manual process is so lengthy and time-consuming. It can also result in some annoying issues which can increase complexities during the process. Thus, many tech experts suggest the users / organizations to use a third-party application such as this Exchange to Office 365 Migration Tool by SysTools.

Download Now Purchase Now

This application has made SysTools a migration leader which makes the entire migration task simple and efficient and eliminates complexities of the manual method. The simple to use graphical interface helps users to carry out the task in an effortless way. Additionally, the trial version is free to use which means you can try all the features of the tool before purchasing the licensed version of the software.

Prominent Features of the Tool:

  • Migrate Exchange 2013, 2016 to Office 365 (Emails, Calendars, Contacts)
  • No Constraints on Number and Size of Exchange On-Premise Mailboxes
  • Feature to Use Filters (Date-Range and Category-Based)
  • Concurrent Migration to Export up to 200 Mailboxes from Exchange Simultaneously
  • Live Process Monitoring and Prioritize Mailboxes for Migration
  • Runs Smoothly on Windows 10, Windows Server 2012, 2016


In the above discussion, proper procedure is discussed to use PowerShell to perform a staged Exchange migration to Office 365 in systematic manner. However, if there is any issue faced while performing the procedure, feel free to drop a comment below, and the issue will be looked by experts.