Mailbox migration to Microsoft 365 is a critical process for organizations transitioning to the cloud. However, administrators may encounter issues with bad items that cause migrations to fail or remain incomplete. This guide explains how to handle bad items during mailbox migrations using PowerShell, including how to troubleshoot errors, increase limits, and finalize the migration successfully.
Bad items refer to corrupt or incompatible data within a mailbox that cannot be migrated to M365. These may include:
When migration tools encounter such data, the process may stop, leaving mailboxes incomplete.
Administrators may see the following errors during migrations:
Error: MigrationPermanentException: TooManyBadItemsPermanentException.
This means the bad item count exceeded the default limit, preventing migration completion.
Follow these steps to resolve migration issues and complete the process:
Run the following command to check the migration status and identify mailboxes with errors:
Get-MigrationUser -BatchId “<BatchName>” | Get-MigrationUserStatistics -IncludeReport | Select-Object DisplayName,Status,ErrorSummary
<BatchName>
with the name of your migration batch.Set a higher limit to allow the migration to continue despite bad items:
Set-MigrationBatch -Identity “<BatchName>” -BadItemLimit 100
Force the completion of the migration batch:
Complete-MigrationBatch -Identity “<BatchName>”
Confirm that the migration is successful:
Get-MigrationBatch -Identity “<BatchName>”
If errors persist, export detailed reports to analyze problematic items:
Get-MigrationUserStatistics -Identity “<UserPrincipalName>” -DiagnosticInfo “IncludeReport” | Export-Csv -Path “C:\BadItemsReport.csv”
<UserPrincipalName>
with the affected mailbox name.For severe data consistency issues, use the mailbox repair tool:
New-MailboxRepairRequest -Mailbox “<UserPrincipalName>” -CorruptionType FolderView
<UserPrincipalName>
with the mailbox name.If the corruption persists despite repairs, administrators may need to:
The default limit is 0. Any bad item causes migration failure unless a higher limit is set.
Use the New-MailboxRepairRequest tool to fix calendar-specific corruption.
Yes, use the ExcludeFolders parameter when creating a migration batch to skip problematic folders.
Completing mailbox migration with bad items in Microsoft 365 requires careful analysis, increased bad item limits, and troubleshooting using PowerShell commands. Administrators should balance migration completion against potential data loss and use repair tools when necessary.
Medha Cloud offers expert Microsoft 365 migration services to ensure seamless transitions, even with complex data challenges. Contact us today to simplify your migration process and optimize your cloud environment.
Reach us at: