TooManyBadItemsPermanentException during migration in Microsoft 365

Original KB number:   4023340


During a migration in Microsoft 365, you received the following error message:



The information in this article may also apply to the "TooManyMissingItemsPermanentException" error because the number of missing items is counted in the bad item limit (but doesn't increment it).


This issue occurs if the number of bad items is greater than the set limit. The migration cannot continue until the limit is increased or set to unlimited.


To resolve this issue, follow these steps:

  1. Export the move request, and then import it to analyze it in PowerShell.

    $stats= Get-MailboxStatistics <SMTP address> -IncludeMoveReport
    $report = $stats.MoveHistory[0].Report
  2. Update the baditemlimit value, which has a default value of 0. Use a larger value or set it to unlimited. (This depends on the number determined in the previous step.)

    Get-Moverequest <identity> | Set-Moverequest –baditemlimit <input value>
    Resume-Moverequest <identity>