Posted on March 20, 2014 · Posted in Exchange

Repair corrupted mailbox in Exchange 2010/2013

This article is devoted to the common problem all Exchange administrators sooner or later come across – user mailbox damage (logical errors). The logical errors in Exchange mailbox will be represented by such problems as incorrect elements display in folder or their incorrect quantity, search errors, etc.

These errors usually appear due to failures on the client’s side, in case when client incorrectly updates MAPI flags during mail folders elements processing, most often this happens with shared mailboxes with which several users work simultaneously. In most cases user can’t suspect errors in his mailbox or folders because formally everything operates correctly. But when some errors happen the user can have mailbox or certain folders access problems, sometimes he can’t view or delete emails or folders which are saved in this mailbox, etc.

In case of such user problems Exchange Server administrator previously had to use one of three ways for recovery of damaged mailbox.

  • Data import from Outlook which is running in cache-able mode to PST file, deletion and creation of new mailbox for “problem” user and lastly data import from PST file to the new mailbox. This method offers certain quantity of manual manipulations on user’s PC.
  • Full disabling (unmounting) of mailbox store and check its with Isinteg.exe utility (Information Store Integrity Checker) which allows to correct damages in Exchange base on application level. This method requires quite long mail service down time for all users whose mailboxes are allocated in disabled mailbox database.

    Note. In some cases you can try to transfer all working user`s mailboxes to the “healthy” mailbox database. In this case you can check store integrity without large quantity of users disabling. However this method is not always acceptable for the different reasons.

  • Restore the Exchange database from backup ( how to backup Exchange 2013 mailbox database), import data from mailbox to PST file and further data transfer to mailbox. This method has one disadvantage – all emails which got to user`s mailbox after last backup execution time can be lost.

Exchange servers administrators had to use all methods described above up to Exchange 2010 SP1 release, when more convenient functional for damaged mailbox logical structure  appeared -  new Powershell cmdlet New-MailboxRepairRequest. This cmdlet allows to find and to correct all logical errors in Exchange database on application level, moreover the search and errors correction can be performed either for the certain mailbox or for all mailboxes in the database (consistently). I.e. there is no need to switch all mail base to off-line mode, and at any particular time only one mailbox will be unavailable, that one for which check and integrity recovery is performed at the moment. Before performing any of described above radical ways to restore of mailbox integrity you should definitely try to use this command.

The syntax of this command is as follows.      

New-MailboxRepairRequest -Mailbox  -CorruptionType <MailboxStoreCorruptionType[]> [-Archive ] [-Confirm []] [-DetectOnly ] [-DomainController ] [-WhatIf []]

Cmdlet allows to perform search and correction of the following damage types in Exchange mailboxes:

  • SearchFolder – folder list search and verification
  • AggregateCounts – check and correction of information about quantity of elements in folders and their sizes
  • FolderView – incorrect content represented by folder view
  • ProvisionedFolder – folder logical structure damage.

The following example will start the process of woshub user mailbox analysis and recovery for all 4 types of failures.

New-MailboxRepairRequest -Mailbox woshub -CorruptionType ProvisionedFolder, SearchFolder, AggregateCounts, Folderview

It is also possible to start errors search and their recovery for all base mailboxes in database:

New-MailboxRepairRequest -Database “NYMailBase1” -CorruptionType ProvisionedFolder, SearchFolder, AggregateCounts, Folderview

The command is performed in background mode and its results are not displayed in PowerShell console. You can trace it with the task identifier RequestID and by Windows event log (event source MSExchangeIS Mailbox Store: EventID 10059-scanning initialization, EventID 10059 successful completion of memory).

Tip. Special cmdlet Get-MailboxRepairRequest appeared in Exchange 2013 which allows getting information about mailbox repair task status.

repair corrupted mailbox in exchange 2013

 Note. After cmdlet initialization the repair process can be stopped only after mailbox database dismount.

Let`s look at one small case as a practice-oriented example of cmdlet usage.

Exchange 2010 user came across emails viewing failure in one of Outlook folders. Appointed folder was recovered from mailbox backup copy. However it appeared impossible to delete the folder itself with a help of MFCMAPI neither from Outlook nor from Outlook Web App nor even from hard or soft. Moreover, Outlook 2010 error gave very little information:

Cannot delete this folder. Right-click the folder, and then click Properties to check your permissions for this folder. See the folder owner or your administrator to change your permissions. Outlook is synchronizing local changes made to items in this folder. You cannot remove this folder until the synchronization with the server is complete

Cannot delete this folder. Outlook Error

For the mailbox integrity check and recovery the following Posh command was started:

New-MailboxRepairRequest -Mailbox -CorruptionType ProvisionedFolder,SearchFolder,AggregateCounts,Folderview

Powershell cmdlet New-MailboxRepairRequest in Exchange2013 After the successful completion of recovery (10048 log event) the damaged folder immediately disappeared from  Outlook Web App, as for the Outlook, here we had to delete local cache (ost file) for correct mailbox display.

Related Articles