Exchange Online Migration: Deprecation of BadItemLimit and use of Data Consistency Score

Hi All,

If you are a frequent Reader of the Exchange Team Blog, then you probably saw, that they announced to depreciate Bad Item Limit (BIL) and Large Item Limit (LIL) until end of 2022.

Let’s see that in Action

Connect-ExchangeOnline
$ONPREMCREDS = get-credential "CORP\Administrator"

Let’s create a MoveRequest with the BadItemLimit Parameter. You see there is a warning.

$Mailbox = "demo02@icewolf.ch"
New-MoveRequest -Identity $Mailbox -Remote -RemoteHostName mail.icewolf.ch -TargetDeliveryDomain icewolfch.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS -BadItemLimit 100

With the MoveRequestStatistics you can see that the DataConsistencyScore is not used

Get-MoveRequest -Identity Demo02@icewolf.ch | Get-MoveRequestStatistics | ft DisplayName, Status, StatusDetail, DataConsistensyScore, BadItemsEncountered, PercentComplete

New MoveRequest without the BadItemLimit or LargeItemLimit Parameter

$Mailbox = "demo04@icewolf.ch"
New-MoveRequest  -Identity $Mailbox -Remote -RemoteHostName mail.icewolf.ch  -TargetDeliveryDomain icewolfch.mail.onmicrosoft.com -RemoteCredential  $ONPREMCREDS -BadItemLimit 100

Now the DataConsistencyScore is used

Get-MoveRequest -Identity  Demo02@icewolf.ch | Get-MoveRequestStatistics | ft DisplayName, Status,  StatusDetail, DataConsistensyScore, BadItemsEncountered, PercentComplete

DataConsistensyScore is “Perfect”

Let’s make some trouble: I’ve added MAPI Permissions with the Icewolf.Exchange.MAPI Module for demo06@icewolf.ch. And then i deleted the demo06 Account and waited until AAD connect has deleted the Account also in ExchangeOnline.

Add-MAPIPermission -Mailbox demo05@icewolf.ch -Trustee demo06@icewolf.ch -AccessRight Reviewer -Folder Inbox -IncludeSubfolders $true

Let’s create another MoveRequest to ExchangeOnline

$ONPREMCREDS = get-credential "CORP\Administrator"
$Mailbox = "demo05@icewolf.ch"
New-MoveRequest -Identity $Mailbox -Remote -RemoteHostName mail.icewolf.ch -TargetDeliveryDomain icewolfch.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS 

As you can see the DataConsistensyScore is not “Perfect” but “Good”

Get-MoveRequest -Identity Demo05@icewolf.ch | Get-MoveRequestStatistics | ft DisplayName, Status, StatusDetail, DataConsistensyScore, BadItemsLimit, BadItemsEncountered, PercentComplete

Let’s find out what caused the DataConsistencyScore to change. It’s the seven Folders with MAPI Permissions where the User was deleted.

$MRS = Get-MoveRequestStatistics demo05@icewolf.ch -IncludeReport -DiagnosticInfo Verbose
$MRS.Report.Failures | group FailureType | fl
$MRS.report.Failures | foreach { $\_ | Select-Object @{name="index";expression={$i}},timestamp,failurecode,failuretype,failureside;$i++} | ft

If you need to Investigate and check - that’s the way to go.

As long the Mailbox has not completed you can always remove the Move Request (Remove-MoveRequest)

Often helps to Move the Mailbox in the Source to another Mailbox Database.

If that does not help try New-MailboxRepairRequest

If you find the Data Loss is Acceptable you can do that with the following Command (Sorry i was not able to create enough trouble to create a Screenshot)

Set-MoveRequest -Identity Demo05@icewolf.ch -SkippedItemApprovalTime $([DateTime]::UtcNow)
Set-MoveRequest -Identity Demo05@icewolf.ch | Resume-MoveRequest

Wish you all the best for your Exchange Migrations!

Regards
Andres Bohren