When performing mailbox migrations, it is utmost important that you stay on top of the progress. However, given the current user interface (UI), it is next to impossible to identify the most current status of mailbox migration. As a result, you find it difficult to report exact status to the concerned teams.
Using this PowerShell script, we can export migration status summary of not only the mailbox for which the migration is complete but also for the mailbox that is still being migrated. Best part of this is that the script runs in the background and saves a separate migration report for each mailbox. This can also be used for auditing purpose post migration, if needed.
Note: Below listed process will only work if the migration batches (containing the email IDs of the users that have been added to the CSV File) exist in the Exchange Admin Center (EAC). It will not work if you have deleted the batches.
The user will have to log out and log back in again so that the role change becomes effective.
Exchange Online PowerShell Module v1 (EXO V1) does not support Multi-Factor Authentication (MFA). So, if the account that you are using for performing the action has MFA enabled, consider using Exchange Online PowerShell Module v2 (EXO V2).
At the time of writing this content, latest version of EXO V2 module was 2.0.4. You can refer to the Release Notes section of this article to get the version of Current Release:
About the Exchange Online PowerShell V2 module | Microsoft Docs
As stated above, only Exchange Online PowerShell version v.2 (EXO V2) requires installation, to install the EXO V2 module for the first time, complete the following steps
If the module is already installed on your computer, you can run the command we shared above to see the version that is currently installed and update it to the latest version using the below command:
To uninstall the module, run one of the below command (in an elevated PowerShell window)
EmailAddress |
Now that you have clarity on whether you are using EXOV1 or EXO V2 PowerShell Module, it should be easy for you to decide which path to follow.
Before you run the script, please ensure you have met all the pre-requisites so that you get the desired outcome. After you confirm having met all the pre-requisites, copy and save the below script in your favourite script editor and save it as a GetMigrationReport.ps1 file ensuring that the script and the CSV File are saved in the same location.
Don’t forget to create a blank folder named Reports at the same location. This is where all the reports will be saved.
#Make sure the csv file is in the same folder where you run this PowerShell from
#Connect to Exchange Online PowerShell
#Change this to path of the csv file that contains EmailAddress of all User Mailboxes you want to get a report for
#Loop through each row in csv
Before you run the script, please ensure you have met all the pre-requisites so that you get the desired outcome. After you confirm having met all the pre-requisites, copy and save the below script in your favourite script editor and save it as a GetMigrationReport.ps1 file ensuring that the script and the CSV File are saved in the same location.
Don’t forget to create a blank folder named Reports at the same location. This is where all the reports will be saved.
#Import Exchange Online PowerShell Module
#Connect to Exchange Online PowerShell
#<UPN> is your account in user principal name format
#Change this to path of the csv file that contains EmailAddress of all User Mailboxes you want to get a report for
#Loop through each row in csv
You can check migration status for a single mailbox using this command:
You can check migration status for a single batch using this command:
We just saw how we can generate migration report for each mailbox via PowerShell.
In this demo we first populate the CSV File with the list of users and then install Exchange Online PowerShell Module. After that we connect to our Microsoft 365 environment and extract the migration reports. This saves lot of time when comparted to manually going to each migration batch and viewing details of each mailbox being migrated.