Skip to content

Repair corrupted mailbox Exchange

The mailbox in Exchange can get corrupted or damaged. It can happen due to various reasons, such as moving a mailbox to another database. It can also occur due to damage because of system failure, improper shut-down of the server, or a virus attack. The user with a corrupted mailbox can have symptoms. Some of the symptoms are incorrect item counts in folders. It’s also possible that results are not displaying correct contents in the search. Let’s find out and learn how to repair a corrupted mailbox.

How to repair corrupted mailbox

Run the New-MailboxRepairRequest cmdlet to detect and repair the corrupted mailbox. The New-MailboxRepairRequest cmdlet is only available for the following Exchange Servers:

  • Exchange Server 2010
  • Exchange Server 2013
  • Exchange Server 2016
  • Exchange Server 2019

Run this command against a specific mailbox or all mailboxes in a database. While this task is running, mailbox access is disrupted only for the mailbox being repaired. If you’re running this command against all mailboxes in a database, only the mailbox being repaired is disrupted. All other mailboxes on the database remain operational. It’s good to know that this will not detect and repair the database itself. It will repair the mailboxes inside the database. After you begin the repair request, you can’t stop the task unless you dismount the database.

The cmdlet can repair four types of mailbox corruptions:

  • Errors in search folders (SearchFolder).
  • Errors in folders counts that aren’t reflecting correct values (AggregateCounts).
  • Errors in folders that aren’t returning correct content (FolderView).
  • Errors in folder structure within a mailbox (ProvisionedFolder).

To avoid any performance problems, there are limits placed on the number of simultaneous repair requests submitted per server. Only one request can be active for a database-level repair, or up to 100 requests can be active for a mailbox-level repair per server.

Repair against a specific mailbox

Detect corruptions only against a specific mailbox without repairing. Run Exchange Management Shell as administrator and run the following command.

[PS] C:\>New-MailboxRepairRequest -Mailbox "john.doe@alitajran.com" -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView -DetectOnly

Identity                                                                  Task                                                           Detect Only Job State Progress
--------                                                                  ----                                                           ----------- --------- --------
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426 {SearchFolder, AggregateCounts, ProvisionedFolder, FolderView} True        Queued    0

Let’s get the status about the repair.

[PS] C:\>Get-MailboxRepairRequest -Mailbox "john.doe@alitajran.com"

Identity                                                                                                       Task                Detect Only Job State Progress
--------                                                                                                       ----                ----------- --------- --------
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\d3a55901-762e-439f-89b0-81cd74732fdf {SearchFolder}      True        Queued    0
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\e9eefd18-301a-45f5-a127-89c54cd2d3cf {AggregateCounts}   True        Queued    0
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\6f10428d-2a9f-4726-8acb-f051e6ab7bfa {ProvisionedFolder} True        Queued    0
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\9f22a529-030b-405d-b121-984be4d5569f {FolderView}        True        Queued    0

It will show the mailbox repair Detect Only as True and Job State as Queued.

You have to wait a bit before the job completes. Run the previous Get-MailboxRepairRequest command. You can keep running the command till you see the Job State as Succeeded.

[PS] C:\>Get-MailboxRepairRequest -Mailbox "john.doe@alitajran.com"

Identity                                                                                                       Task                Detect Only Job State Progress
--------                                                                                                       ----                ----------- --------- --------
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\d3a55901-762e-439f-89b0-81cd74732fdf {SearchFolder}      True        Succeeded 100
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\e9eefd18-301a-45f5-a127-89c54cd2d3cf {AggregateCounts}   True        Succeeded 100
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\6f10428d-2a9f-4726-8acb-f051e6ab7bfa {ProvisionedFolder} True        Succeeded 100
68db0169-cafc-4144-87b3-797e1fe1720d\f568b725-65a3-4e3a-b865-aa24cc009426\9f22a529-030b-405d-b121-984be4d5569f {FolderView}        True        Succeeded 100

Detect and repair corruptions on the specific mailbox.

[PS] C:\>New-MailboxRepairRequest -Mailbox "john.doe@alitajran.com" -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView

Identity                                                                  Task                                                           Detect Only Job State Progress
--------                                                                  ----                                                           ----------- --------- --------
68db0169-cafc-4144-87b3-797e1fe1720d\f1347601-ac44-455f-81f3-0b50d56aa92c {SearchFolder, AggregateCounts, ProvisionedFolder, FolderView} False       Queued    0

It is also possible to only use one of the four types of mailbox corruptions against a specific mailbox.

[PS] C:\>New-MailboxRepairRequest -Mailbox "john.doe@alitajran.com" -CorruptionType SearchFolder

Identity                                                                                                       Task           Detect Only Job State Progress
--------                                                                                                       ----           ----------- --------- --------
68db0169-cafc-4144-87b3-797e1fe1720d\404e2799-b7e8-4e6d-b3db-54333d2ee118\8cbc3d82-b9bb-4821-bc91-0d50d392f35a {SearchFolder} False       Queued    0

You can use the name of the user if you don’t know the email. Replace email john.doe@alitajran.com with username Doe John.

Repair against all mailboxes in a database

Detect corruptions only against all mailboxes in a database without repairing. In this example, we use database DB1.

[PS] C:\>New-MailboxRepairRequest -Database "DB1" -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView -DetectOnly

Get the mailbox repair status in a database.

[PS] C:\>Get-MailboxRepairRequest -Database "DB1"

Detect and repair corruptions on the mailboxes in a database.

[PS] C:\>New-MailboxRepairRequest -Database "DB1" -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView

It is also possible to only use one of the four types of mailbox corruptions against all mailboxes on a database.

[PS] C:\>New-MailboxRepairRequest -Database "DB1" -CorruptionType ProvisionedFolder

Keep reading: Repair failed content index in Exchange »

Conclusion

It’s great to have the New-MailboxRepairRequest cmdlet to detect and repair a corrupted mailbox. It’s even better that you learned how to apply it against a specific mailbox or all mailboxes in a database.

Did you enjoy this article? You may also like Get Exchange 2010 user mailboxes. Don’t forget to follow us.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 6 Comments

  1. Hi Ali.
    Thanks for this great post.
    I would like to know if Job State Succeeded an indication for us to start the reparing action? What is the indication to start the reparing action?

  2. hello Ali what about when you for example i new mailbox repair command+ the following attributes as well what do those do?
    normal comand from your example ProvisionedFolder,SearchFolder,AggregateCounts,Folderview +
    ,CleanupOrphanedIndexes,CorruptedPerUserData,CorruptSearchFolderCriteria,CleanupFilesFolder

Leave a Reply

Your email address will not be published. Required fields are marked *