Exchange 2010 SP1 Database Integrity Checking

Since the earliest versions of Exchange Server, the Information Store Integrity Checker (ISInteg) has offered Exchange administrators a way to check mailbox and public folder database integrity. ISInteg checks and fixes Exchange database errors that may prevent the database from mounting, prevent the user from logging on or from receiving, opening or deleting email. Curious to know what changes are coming to ISInteg in Exchange 2010 SP1? Let’s take a look.

In Exchange 2010 SP1, ISInteg is no longer a standalone program.

The functionality provided by the ISInteg tool has been rolled into two new Exchange Management Shell cmdlets:

New-MailboxRepairRequest
New-PublicFolderDatabaseRepairRequest
Note: Like other Shell cmdlets, these are subject to Role-Based Access Control (RBAC) scoping restrictions. For details, see Understanding Management Role Scopes.
Cool Features
These new ISInteg cmdlets come with some cool new functionality!
The cmdlets work with the database mounted. It’s no longer required to unmount the database to perform an integrity check or fix database errors.
You can repair logical corruption at the mailbox level.
You can fix corrupt search folders.
You can fix the Provisional Fid.
You can fix Aggregate Counts.
ISInteg can now work at the database or mailbox level
How does it do that? Well, the new schema in Exchange 2010 effectively partitions the database by mailbox. So the top problems fixed by ISInteg are now mostly limited to the affected mailboxes only. Previous versions of ISInteg required the database to be offline while validation and fixing are in progress. In Exchange 2010 SP1, the ability to do these checks at the mailbox level removes the need to dismount the database. It is actually required to have ISInteg operate against an online database!

New-MailboxRepairRequest
The New-MailboxRepairRequest cmdlet detects and fixes the following types of mailbox corruptions:
Search folder corruptions (SearchFolder): Repair tasks now look for all folders named in ptagSearchBacklinks, ptagSearchFIDs, and ptagRecursiveSearchFIDs and verifies that each folder exists. If the folder no longer exists, then it will remove that folder from the list.
Aggregate counts on folders that aren’t reflecting correct values (AggregateCounts): Repair tasks tally all messages in a folder and keep a running total of various counts and sizes. Once the iteration is complete, it will verify the computed counts against the persisted counts on the Folders table record for the folder. If there is a discrepancy, it will update the persisted counts to reflect the computed counts.
Views on folders that aren’t returning correct contents (FolderView): Repair tasks will iterate over all views for a folder and for each one, bring the view fully up to date and then reconstruct a temp copy. If there is a discrepancy between the existing view and the contents of the temp table, it will delete the view so it can be rebuilt from scratch the next time it is requested.
Provisioned folders that are incorrectly pointing into unprovisioned parent folders (ProvisionedFolder): Repair tasks can fix Provisioned folders incorrectly pointing into unprovisioned parents or vice versa.
Syntax
New-MailboxRepairRequest -Mailbox <MailboxIdParameter> -CorruptionType <MailboxStoreCorruptionType[]> [-Archive <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

New-MailboxRepairRequest -Database <DatabaseIdParameter> -CorruptionType <MailboxStoreCorruptionType[]> [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

Parameters
Database, Mailbox and Archive: You can repair an entire mailbox database or a specified mailbox by specifying either the Database or the Mailbox parameter. You can’t use both. To repair the archive mailbox for the specified user, use the Archive switch.
CorruptionType: (at least 1 required) you are already familiar with, we discussed them above:
SearchFolder
AggregateCounts
ProvisionedFolder
FolderView
You can run a repair task with multiple parameters if you separate them with a comma (as shown in the Examples section below).

DetectOnly: (Optional) The DetectOnly switch secifies that you want this command to report errors, but not fix them. You don’t have to specify a value with this switch.
Other Optional Parameters: This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type “get-help about_commonparameters”.
New-PublicFolderDatabaseRepairRequest
The New-PublicFolderDatabaseRepairRequest cmdlet detects and fixes Public Folder replication state problems.

Syntax
New-PublicFolderDatabaseRepairRequest -Database <DatabaseIdParameter> -CorruptionType <PublicFolderDatabaseCorruptionType[]> [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

Parameters
Database: (required) Specifies the Public Folder database on which you will run this command. You can use one of the following values:
GUID of the database
Database name
CorruptionType: (required) Pretty easy, there’s only one value.
ReplState
DetectOnly: (optional) Specifies that you want this command to report errors, but not fix them. You don’t have to specify a value with this parameter.
Other Optional Parameters: This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type “get-help about_commonparameters”.
Examples
New-MailboxRepairRequest -Mailbox administrator@contoso.com -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView

New-MailboxRepairRequest -Mailbox administrator -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView -WhatIf

New-PublicFolderDatabaseRepairRequest -Database PFD01 -CorruptionType ReplState -DetectOnly

Some additional examples are provided in the cmdlet help. You can retrieve them using the following commands, or refer to New-MailboxRepairRequest and New-PublicFolderDatabaseRepairRequest cmdlet reference:

Get-help New-MailboxRepairRequest -examples
Get-help New-PublicFolderDatabaseRepairRequest -examples

I recommend that you get to know the cmdlets by using the cmdlet reference docs, or by using the following commands to retrieve detailed help from the shell:

Get-help New-MailboxRepairRequest -detailed (or -full)
Get-help New-PublicFolderDatabaseRepairRequest -detailed (or -full)

Event Reporting
After submitting the Mailbox or Public Folder repair request, you can monitor its progress with the Event Viewer. That’s right, no more text logs to weed through. The events are logged under the MSExchangeIS Mailbox Store source.

The following event IDs will be logged for repair requests:

10047 A mailbox-level repair request started
10064 A Public Folder repair request started
10048 The repair request successfully completed.
10050 The mailbox repair request task skipped a mailbox .
10059 A database-level repair request started.
10062 Corruption was detected.

Figure 1: Mailbox or Public Folder database repair request events are logged in the Application event log
Note: the repair events will only show up on the mailbox server where the mailbox or Public Folder is located.

This is very important to remember. Just because you fired off a repair task on a mailbox server does not mean the events will show up on that server. The repair task will be run on the database where the mailbox itself is, and the events will be in the event log on that mailbox server and that server alone.

Things to remember:

Only 1 active repair task is permitted to be running per server if the active task is a database level repair.
Only 100 mailbox level active repair tasks are permitted to be running at once per server.
There is no -Server parameter to do all databases or mailboxes on a server.
The repair task dies on database dismount or store stop/crash.
The only way to stop a repair is to stop the store or dismount the database.
Mailbox access will be disrupted for the mailbox that is being repaired.
Repair for a mailbox will skip a mailbox if it has been quarantined.
Repair will cause a move-mailbox operation to be delayed until the repair is completed.