How to Get Mailbox Migration Status with PowerShell

Tracking mailbox migration status in Microsoft 365 is critical during migrations to ensure a smooth transition. While the Exchange Admin Center provides migration status, it is often delayed and challenging to interpret, especially when managing multiple migration batches. This article explains how to use PowerShell to monitor mailbox migration status and export reports to a CSV file for detailed analysis.
Why Monitor Mailbox Migration Status?
Mailbox migrations can involve hundreds of users, and tracking their progress ensures:
- Early detection of errors.
- Monitoring synchronization progress.
- Ensuring successful migration completion.
- Generating reports for compliance and audits.
Using PowerShell provides real-time updates and makes it easier to analyze large migration batches than relying on the graphical interface in the Exchange Admin Center.
Step-by-Step Guide to Check Mailbox Migration Status with PowerShell
Step 1: Connect to Exchange Online with PowerShell
- Open PowerShell on your computer.
- Install the Exchange Online Management Module (if not already installed):
Install-Module -Name ExchangeOnlineManagement - Import the module:
Import-Module ExchangeOnlineManagement - Connect to Exchange Online:
Connect-ExchangeOnline -UserPrincipalName admin@domain.com
Step 2: Retrieve Migration Batch Information
To view all migration batches, run:
Get-MigrationBatch
This command lists active migration batches along with their statuses.
Step 3: Check Migration Status for Users
To view details about individual mailboxes in a specific batch, use:
Get-MigrationUser -BatchId "BatchName" | Select DisplayName, Status, PercentageComplete
Replace "BatchName" with the actual name of your migration batch.
Output Example:
| DisplayName | Status | PercentageComplete |
|---|---|---|
| John Doe | Syncing | 75% |
| Jane Smith | Completed | 100% |
| Mike Johnson | Failed | 0% |
Step 4: Export Migration Status to CSV File
Export the migration report to a CSV file for easier review and sharing:
Get-MigrationUser -BatchId "BatchName" | Select DisplayName, Status, PercentageComplete | Export-Csv -Path "C:\MigrationStatus.csv" -NoTypeInformation
This creates a file named MigrationStatus.csv in the *C:* directory.
Step 5: Check Detailed Migration Statistics
For additional details, such as error messages, use:
Get-MigrationUserStatistics -Identity user@domain.com | Select-Object DisplayName, Status, ErrorMessage
To export detailed statistics for all users:
Get-MigrationUser | Get-MigrationUserStatistics | Export-Csv -Path "C:\MigrationFullReport.csv" -NoTypeInformation
Step 6: Disconnect Exchange Online Session
When finished, disconnect the session to ensure security:
Disconnect-ExchangeOnline
Common Errors and Troubleshooting Tips
| Error Message | Possible Cause | Solution |
|---|---|---|
| "Cannot open mailbox" | Permissions issue | Verify the admin account has necessary roles. |
| "Failed" status in migration batch | Sync or network issues | Restart migration and check connectivity. |
| "Mailbox already exists" | Duplicate migration attempts | Remove duplicate entries from migration batch. |
Benefits of Using PowerShell for Migration Tracking
- Real-time updates: Faster and more accurate than the Admin Center.
- Scalable reporting: Handles multiple batches and hundreds of users efficiently.
- Customizable exports: CSV output allows integration with other tools and compliance reports.
- Detailed error tracking: Provides insights into failures for quick troubleshooting.
Frequently Asked Questions (FAQs)
1. Can I track migration progress for multiple batches at once? Yes, use the command Get-MigrationUser without specifying a batch to view all users across batches.
2. Do I need administrative permissions to use these commands? Yes, you need Exchange Administrator or Global Administrator permissions.
3. How often should I check migration status? For large migrations, it’s recommended to check status every 15-30 minutes.
4. What should I do if a migration batch fails? Check error messages using PowerShell and restart the migration batch if needed.
Conclusion
Monitoring mailbox migration status with PowerShell simplifies the process and provides real-time insights into migration progress. By exporting data to CSV files, administrators can easily track and report migration status, ensuring smooth transitions to Microsoft 365.
Need Help Managing Microsoft 365 Migrations?
Medha Cloud specializes in Microsoft 365 migration planning, execution, and support. Contact us today to streamline your migration process and minimize downtime.
Contact Medha Cloud for expert assistance!
Reach us at:
- India: +91 93536 44646
- US: +1 646 775 2855
- Website: www.medhacloud.com
- Email: info@medhacloud.com