Monitor Work from Home Employees with Employee Desktop Live Viewer.

Read More

How to Perform IMAP Migration to Office 365 with PowerShell Commands?

Himanshu Goyal
Himanshu Goyal Updated On - 22 Dec 2020

Migrating IMAP mailboxes to Office 365 is one of the most challenging tasks, as you cannot perform this migration without proper guidance and knowledge. But Microsoft takes care of this problem for you, it provides an efficient way to perform IMAP Migration to Office 365 using Exchange Online PowerShell Commands. So, let’s have a look at how PowerShell works in migrating an IMAP mailbox to Office 365.

Things You Need to Know Before Starting IMAP to Office 365 Migration

The IMAP to Office 365 migration using PowerShell consists of some important things that you should know:

  • You’ll have to create a migration batch which will take 2-5 mins.
  • The migration time will depend on the number of mailboxes in the batch.
  • You need necessary permissions to perform this procedure. To know more about the permissions, you can visit Recipients Permissions.
  • To use PowerShell commands, you need to sign in and import the cmdlets into your local Windows PowerShell session. To know about migration commands, visit move and migration cmdlets.

Restrictions that Comes with PowerShell Command for IMAP Migration to Office 365

There are some restrictions that apply to Exchange Online PowerShell while performing IMAP to Office 365 migration.

  • PowerShell doesn’t allow you to migrate contacts, calendars, or tasks from IMAP mailboxes. You can only migrate emails/items from inbox or other mail folders.
  • The maximum number of items that can be migrated from a user’s mailbox is 500,000.
  • The size limit of a message for migration is 35 MB.

IMAP Migration to Office 365 Step by Step Procedure

  1. Preparing for IMAP Migration

    The IMAP to Office 365 migration involves several steps for its preparation.

    • Add your IMAP organization domain as an accepted domain to your Office 365 organization
    • Add each user to Office 365 to give them access to Office 365 mailboxes
    • Obtain the FQDN of the IMAP server
    • Configure firewall to allow IMAP connections
    • To access IMAP mailboxes, assign the administrator account permissions in your organization.
    • Import Exchange Online cmdlets to Windows PowerShell to connect to Exchange Online
    • Verify if you can connect to the IMAP server.
  2. Creating CSV File for IMAP Migration Batch

    Find the mailboxes that you want to migrate in an IMAP migration batch. For different IMAP servers, different formats are used to create a CSV file. Generally, the CSV file requires the email address, username, and password of each user.

  3. Create an IMAP Migration Endpoint

    For successful email migration, Office 365 needs to connect with the source email system using a migration endpoint. The migration endpoint defines the number of mailboxes to migrate and to synchronize simultaneously during incremental synchronization. You need to connect to Exchange Online to create a migration endpoint for IMAP migration. Use the following command in PowerShell to create an Endpoint.

    New-MigrationEndpoint -IMAP -Name IMAPEndpoint -RemoteServer -Port 993 -Security Ssl
  4. Start Migration

    First, create a migration batch using New-MigrationBatch cmdlet for an IMAP migration; it will start automatically if you include the AutoStart parameter. You can also start the migration batch by using Start-MigrationBatch cmdlet.

    Use the following PowerShell command to automatically start the migration batch called “IMAPBatch1” with IMAP Endpoint.

    New-MigrationBatch -Name IMAPBatch1 -SourceEndpoint IMAPEndpoint -CSVData ([System.IO.File]::ReadAllBytes(“C:\Users\Administrator\Desktop\IMAPmigration_1.csv”)) -AutoStart
  5. Route Incoming Emails to Office 365

    Every email system uses a DNS record known as MX record to figure out where to deliver emails. During the migration process, the MX record points toward the source email system. Once the email migration to Office 365 is complete, point MX record towards Office 365. It will make sure that emails are delivered to Office 365 mailboxes. Moving your MX record also allows you to turn off your old email system.

    There are some specific instructions to change the MX record for many DNS providers. It will take up to 72 hours for the email systems to recognize the modified MX record. So, you’ll have to wait 72 hours to proceed to the next step.

  6. Delete the Batch after IMAP Migration

    Once the MX records are changed, and the emails are routed to Office 365, you can inform users about their mails going to Office 365. Then you can delete the IMAP migration batch but verify the below points before removing the migration batch.

    • Make sure all users are using Office 365 mailboxes.
    • Synchronized Office 365 mailboxes at least once after the migration.
    • Now, run the following command to delete the migration batch.

      Remove-MigrationBatch -Identity <batch name>

      You can learn more about the Remove-MigrationBatch cmdlet.

      After removing the migration batch, verify whether it is completely removed or not. Run the following command to verify this:

      Get-MigrationBatch <batch name>

      Using the PowerShell command, you can move IMAP mailboxes to Office 365. However, this process is little daunting, and so you need technical expertise to perform it. Therefore, you need an efficient solution to move IMAP mailboxes to Office 365.

Disadvantages of Using PowerShell Command for IMAP Mailboxes Migration to Office 365

IMAP to Office 365 with PowerShell cmdlets is feasible but a little daunting and challenging for non-technical users. Any minor mistake could result in the failure of the migration. And you need technical expertise to perform it accurately. Otherwise, there could be data loss or some errors and issues leading to more problems. Therefore, you need an efficient solution to move IMAP mailboxes to Office 365.

Migrate IMAP to Office 365 without PowerShell cmdlets – Kernel IMAP to Office 365

It is an efficient tool that is specially designed to migrate IMAP to Office 365 mailboxes. Even non-technical users can migrate their IMAP mailboxes to Office without any guidance. It is enhanced with unique and great features that make it one of the best IMAP to Office 365 migration tools. Some of its features include:

  • Allows migration of single/multiple mailboxes from IMAP email servers
  • Offers batch migration of IMAP mailboxes using CSV file
  • Allows migrating archive mailboxes and public folders
  • Advanced features to migrate specific mailbox data based on date, item type, etc.
  • Saves migration summary in CSV format after successful migration
  • Compatible with all IMAP servers including Yahoo, Gmail, G Suite, etc.

To know more about the tool, have a look at the video of software process-


The complexity of PowerShell Command makes it challenging for non-technical users to perform IMAP to Office 365 migration. So, a third-party software is the only option that is suitable for every user. You can quickly migrate IMAP mailboxes to Office 365 using Kernel IMAP to Office 365 tool.