How to Migrate IMAP Mailbox to Office 365 using PowerShell – Complete DIY Guide

migrate imap mailbox to Office 365

Mohit Jha | Modified: January 23, 2023 | Migration, Office 365 | 9 Minutes Reading

Overview: This article endeavors to provide the best insights to users who want to migrate IMAP mailbox to Office 365. In the following write-up, you will get to know; “how to use PowerShell commands to move IMAP email to Office 365?” Let’s get into it!

As we all know Office 365 offers a more robust and collaborative email and office suite solution than traditional IMAP email accounts. Moreover, there are several benefits of using the Office 365 suite over IMAP. It is a subscription-based online version of the Microsoft Office Suite. It includes features such as email, calendar, and task management, as well as document collaboration and storage through OneDrive and SharePoint.

One benefit of using Office 365 over IMAP email is that it allows for better collaboration and real-time editing of documents through its integration with other Office applications such as Word, Excel, and PowerPoint. Additionally, Office 365 includes built-in spam and malware protection, which can help to keep your inbox free from unwanted messages.

Another benefit of Office 365 is that it includes much more storage capacity than traditional IMAP email accounts, which may only offer a few gigabytes of storage. Office 365 also offers a feature-rich web interface and mobile apps for easy access to emails, calendars, and contacts from anywhere. 

Now the main question is how to proceed with this operation. Let’s discuss the quick steps first in brief and then will discuss them in detail.

6 Quick & Easy Steps to Migrate IMAP Email to Office 365

  • Step 1. Download, Install and Launch the Software.
  • Step 2. Choose IMAP and Office 365 as Source and Destination.
  • Step 3. Enable Email from Workload Selections and Apply Filter.
  • Step 4. Provide Source IMAP Details and Validate Permissions.
  • Step 5. Provide Destination Office 365 Details and Validate Permissions.
  • Step 6. Create User Mapping, Validate Permissions and Click on Start Migration.

Things to Consider Before Migrating IMAP Mailbox to Office 365 

The things that a user should keep in mind while trying to import IMAP mail to Office 365 are as follows:

  • In order to use the Exchange Online PowerShell cmdlet, the user needs to properly sign in and import commands into the Local Windows PowerShell section.
  • Users must be assigned full rights and permissions required to migrate IMAP mailbox to Office 365 before starting the process.
  • Restrictions associated with IMAP migration to Office 365 are:
    • Users can transfer only the items in the user’s inbox and other folders.
    • The user can only transfer 500,000 items at once.
    • 35 MB is the largest message size that the user can move using this method.

Migrate IMAP Mailbox to Office 365 With PowerShell Command

Users need to follow these steps to transfer IMAP to Office 365 using PowerShell:

1. Preparing for IMAP to Office 365 Migration

  1. If you have a domain for the IMAP organization, you need to add it as an accepted domain for the Office 365 organization. If you wish to use the same domain you already own for Office 365 mailboxes, you need to create users in Office 365 after adding the domain as an accepted domain to Office 365.
  2. The next step involves adding users to Office 365 so that each user has an Office 365 mailbox.
  3. You need to provide the Fully Qualified Domain Name (FQDN) of the IMAP server, from which you will migrate mailbox data while creating an IMAP to Office 365 migration endpoint. The user needs to verify if the FQDN is suitable for communicating with IMAP Server through the internet. To do this, either uses the IMAP client or the PING command to verify if
  4. To allow IMAP connections to migrate IMAP mailbox to Office 365, you need to open ports in the Firewall of the organization hosting the IMAP server so that network traffic originating from the Microsoft Datacenter at the time of migration is not restricted.
  5. The Administrator needs to be assigned with necessary account permissions for accessing on-premises mailboxes in the IMAP organization. Store these account credentials in CSV file format. Also, the permissions required to access mailboxes depend on the particular IMAP server.
  6. You need proper sign-in to import and use the Exchange Online PowerShell cmdlet into the local Windows PowerShell Session to migrate IMAP mailbox to Office 365.

Use the following commands to test connection settings in Exchange Online PowerShell for verifying that you can connect to IMAP Server:


Note: The value of the Port is usually set as 143 for Unencrypted/ TLS and 993 for SSL connections

2. Creating CSV File to Migrate IMAP Mailbox to Office 365

Now, the user has to specify the user accounts for migration by creating a CSV file containing all the user accounts. The rows in the CSV file will contain the information required to connect to the mailbox in the IMAP messaging system. The information needed for each user to migrate IMAP mailbox to Office 365 is as follows:

  1. EmailAddress → defines user ID for the user’s office 365 mailbox
  2. UserName → specifies the login name for the account used to access the mailbox

    iii. Password → Defines password for the account in the UserName column

Example of the CSV file:

EmailAddress, UserName, Password, sherly.walkers, 123456

3. Creating Migration Endpoint

Office 365 needs to be connected and communicated with the source email system for successful email migration. For this, a migration endpoint is used that defines a number of mailboxes to migrate altogether & mailboxes to synchronize simultaneously during incremental synchronization that happens every 24 hours. Now, we will create an IMAP migration endpoint by connecting to Exchange Online and checking the list of migration commands. We will execute the following commands to create an IMAP migration endpoint named ‘Endpoint1’ in Exchange Online to migrate IMAP mailbox to Office 365 step by step:


Note: Use these commands ‘Get-MigrationEndpoint Endpoint1| Format-List EndpointType, RemoteServer, Port, Security, Max*’ to know about Endpoint1.

4. Initiating Migration Batch to Migrate IMAP Email to Office 365

In this step, we will create a migration batch for IMAP migration using the New-MigrationBatch cmdlet. After creating it, we can make it start either automatically using AutoStart parameter or start it later using the Start-MigrationBatch cmdlet.

Use the following cmdlet:


Note: We can get info on the IMAP migration batch using “Get-MigrationBatch -Identity IMAPBatch1 | Format-List”

5. Routing Email to Office 365 for IMAP to Office 365 Migration

Now, a DNS Record called MX Record is used to ensure that emails are to the Office 365 mailboxes. Earlier, the MX record was pointing to the source email system at the time of the email migration process. After moving the MX Record, the user can turn off the source email system once it is ready. We will change MX Record using instructions given by many DNS providers and it will approximately take 72 hours for the email systems to recognize the changed MX Record.

Note: It is recommended to wait for 72 hours before the user proceeds to the next step.

6. Deleting IMAP Migration Batch

Notify the users that their emails are going to Office 365 after changing the MX Record and verifying all emails are being routed to Office 365 mailboxes. Now, delete the IMAP migration batch after completing IMAP to Office 365 migration and  verifying the following:

  • Every user is using Office 365 mailboxes. After deleting the batch, mail sent to mailboxes on the On-premises Exchange server is not copied to corresponding mailboxes of Office 365.
  • To ensure that mailboxes of Office 365 were synchronized at least once after mail starts to route directly to them, set the value in the Last Synced Time box as more recent than starting time of mail being routed to Office 365 mailboxes.

Use the following commands to delete the IMAP migration batch “Remove-MigrationBatch -Identity IMAPBatch1”. Similarly, we can get the information about the migration batch using ‘Get-MigrationBatch Batch1’.

Also Read: Learn to Migrate Lotus Notes to Office 365 With Top Solutions

Automated and Reliable Approach to Migrate IMAP Email to Office 365

Using Powershell to move email data from IMAP to Office 365 can become a hectic process. The process is unnecessarily long and requires a lot of effort. We suggest using a professional-grade solution such as SysTools IMAP to Office 365 Migrator. This software is a tried and tested utility that is designed to minimize user effort and maximize efficiency.

Download Now Purchase Now

Benefits of Using This Tool

The tool has certain features and functionalities that are a must-have for IMAP to Office 365 migration. We have listed a few of these features below:

  • The Date-Range and Category filters integrated into the tool help users selectively migrate the data.
  • The tool can facilitate the migration of multiple IMAP accounts simultaneously with the help of an advanced feature like Concurrent Migration.
  • User has to option to stop the migration process whenever necessary with the help of the Stop Import button.
  • This tool has migration support for all IMAP-based email clients. Some of them are Gmail, Mozilla Thunderbird, Apple Mail, Eudora, Pegasus Mail, and Microsoft Mail.
  • After the completion of the migration process, the user can use the Re-Run Migration or Retry Failed Items option to repeat the migration process again.
  • The Delta Migration option can be sued for migrating the data that arrived during the previous migration procedure i.e., the freshly arrived data.
  • The user can assign priority to the user accounts before starting the migration. The tool will migrate the user accounts marked with the priority setting before the other accounts.
  • When the migration completes, the user is able to download a report containing details of the migration process. The tool can generate two types of reports – Summary Reports and Detailed Reports.

Software Steps to Follow to Use Professional Utility

The tool can migrate the data from IMAP to Office 365 in a few simple steps. These steps are easy-to-follow and the migration will be complete in just a few clicks.

Step 1. To start, download the IMAP to Office 365 Migration tool and open it.

Step 2. The tool opens on the Setup screen. Here, select IMAP and Office 365 as source and destination respectively, and click Next.

Step 3. The tool will switch to the Source screen, here the user is required to provide the details of the desired IMAP server.

Step 4. On the next screen, the user has to input the details for the destination Office 365 account also to migrate IMAP mailbox to Office 365.

Step 5. Choose any of the options provided on the Users screen to map the source and destination users and validate the permissions.

Step 6. Now, click on the Start Migration button to migrate IMAP email to Office 365 safely.

Also Read: What You Need to Know About a Staged Email Migration to Office 365 – Technical Guide


With the superior features that come with office 365, users tend to perform migration of IMAP mails to office 365. The above article has discussed how to migrate IMAP mailbox to Office 365 which will guide users who wish to transfer from the mail contents in user mailboxes of Internet Mail Access Protocol Service to Office 365 email service. It explains the detailed steps that use PowerShell to perform an IMAP Migration to Office 365.