MFCMAPI CORRUPT MAILBOX ITEMS
When mailboxes fail to onboard correctly, the two main reasons are invalid folder structures or corrupt mailbox items. This document will deal with the second scenario.When the Exchange synchronisation engine is synchronizing folder structures, if it encounters any corrupt items and the baditemcount has not been modified, the action will fail with an error:
To solve this error we first need to attempt a mailbox repair using Powershell.
To monitor the restore request we need to examine the application context event logs on the mailbox server hosting the content. Examine the event logs and see the result of the repair request:
Attempt the onboarding request again and examine the migration log. Any failures are likely to be corrupt items in the folder referenced in the failure log. In this example, there are multiple, corrupt items in the deleted items folder.
It is likely that any attempt to delete these using Outlook will fail with the following message:
We will need to use the MFXMAPI tool to delete these objects. Download the latest stable binaries of MFCMAPI from Sourceforge: https://github.com/stephenegriffin/mfcmapi/releases/tag/18.2.18068.37 (correct as of 10/4/2018) Unzip the MFCMAPI and ensure that you have FullAccess permissions to the mailbox within Exchange. We will also need to ensure that we disable cached Exchange mode to allow full availability of all mailbox contents.
Create an Outlook profile in the usual manner and open MFCMAPI with elevated privilege. Then click Session and Logon:
Select your Outlook profile and click OK
Double click the object that is listed as the default store for the profile.
Expand Root Container > Top Of Information Store and right click the folder where the corrupted items are reportedly located and choose Open Contents table.
Locate the corrupted items from their time stamps and group select, right click and select Delete Message:
Select Permanent delete Passing DELETE_HARD_DELETE (unrecoverable) and click OK.
Now click Session and Logoff
Repeat the process until no migration errors are encountered when onboarding the mailbox to Exchange online.
Expand Root Container > Top Of Information Store and right click the folder where the corrupted items are reportedly located and choose Open Contents table.
Locate the corrupted items from their time stamps and group select, right click and select Delete Message:
Select Permanent delete Passing DELETE_HARD_DELETE (unrecoverable) and click OK.
Now click Session and Logoff
Repeat the process until no migration errors are encountered when onboarding the mailbox to Exchange online.