Read time 6 minutes

Summary: This blog discusses the challenges of migrating IMAP mailboxes to Office 365 and how Microsoft provides a solution through PowerShell commands. It covers key considerations, restrictions, and a step-by-step procedure for the migration process. The article also highlights the complexity of using PowerShell for non-technical users and recommends Kernel IMAP to Office 365 as an efficient third-party solution for a smoother migration experience.

Migrating IMAP mailboxes to Office 365 presents a formidable challenge that demands careful guidance and expertise. Fortunately, Microsoft has devised an effective solution to address this complexity. By leveraging the power of Exchange Online PowerShell Commands, you can seamlessly execute the IMAP migration process to Office 365. Let’s delve into the workings of PowerShell and its role in facilitating the migration of IMAP mailboxes to the Office 365 environment.

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

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.
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.

Create an IMAP Migration Endpoint

To ensure a smooth email migration process, it is essential for Office 365 to establish a connection with the source email system through the utilization of a migration endpoint. This migration endpoint serves as a crucial parameter, defining both the quantity of mailboxes to migrate and the degree of simultaneous synchronization during incremental synchronization. To initiate this process, it is necessary to establish a connection with Exchange Online for the purpose of creating a migration endpoint tailored for IMAP migration. To achieve this, you can utilize the following PowerShell command to generate the required endpoint.

New-MigrationEndpoint -IMAP -Name IMAPEndpoint -RemoteServer -Port 993 -Security Ssl
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
Route Incoming Emails to Office 365

Every email system relies on a DNS record called the MX record to determine the destination for email delivery. Throughout the migration process, the MX record initially directs emails to the current source email system. After the successful completion of the email migration to Office 365, the MX record should be reconfigured to direct email traffic to Office 365. This adjustment ensures that all incoming emails are correctly delivered to Office 365 mailboxes. Furthermore, updating your MX record grants you the ability to decommission your old email system, streamlining your email infrastructure.

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.

Delete the Batch after IMAP Migration

After updating the MX records to route emails to Office 365, it’s essential to notify users about this change in email routing to Office 365. Subsequently, you can proceed with the removal of the IMAP migration batch. However, it is crucial to perform the following verification steps before deleting 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>

    With the assistance of PowerShell commands, migrating IMAP mailboxes to Office 365 is possible. Nevertheless, this procedure can be somewhat challenging, requiring a certain level of technical proficiency. As a result, seeking an efficient solution for transferring IMAP mailboxes to Office 365 becomes imperative.

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

Migrating from IMAP to Office 365 using PowerShell cmdlets is indeed possible, yet it can pose a significant challenge, especially for users who are not well-versed in technical aspects. Even the slightest error during the migration process can lead to a failure, making it crucial to possess a strong technical background to ensure a flawless execution. Without the necessary expertise, there’s a risk of data loss or encountering various errors and complications that may exacerbate the situation. Consequently, it is imperative to explore a more efficient and user-friendly solution for transferring 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.


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.