I recently assisted a client over the weekend to patch their Exchange 2010 infrastructure with the latest service pack and rollup packs, and one of the issues I came across after the patching was that some of the database content indexes would be listed as Failed. This problem is one that I encounter quite frequently but never remember the exact cmdlet to correct the problem so this blog post serves to be something I can reference to in the future.
The following cmdlet can be used to list all of the databases and the health of the Content Index State:
Get-MailboxDatabaseCopyStatus -server <mailboxServerName>
The following cmdlet can be used to list only the databases with failed database content indexes:
Get-MailboxDatabaseCopyStatus –server <mailboxServerName | where {$_.contentindexstate -like "Failed"}
The following cmdlet will retrieve all of the databases with the content index listed as failed then use the Update-MailboxDatabaseCopy cmdlet to fix the indexes:
Get-MailboxDatabaseCopyStatus –server <mailboxServerName>| where {$_.contentindexstate -like "Failed"}
| Update-MailboxDatabaseCopy -catalogonly
The following is a sample output of the series of cmdlets used:
[PS] C:\Windows\system32>Get-MailboxDatabaseCopyStatus -server exmb01
Name Status CopyQueue ReplayQueue LastInspectedLogTime ContentIndex
Length Length State
---- ------ --------- ----------- -------------------- ------------
DB06\EXMB01 Healthy 0 0 3/28/2015 6:17:07 PM Healthy
DB05\EXMB01 Healthy 0 0 3/28/2015 6:15:10 PM Healthy
DB04\EXMB01 Healthy 0 0 3/28/2015 6:10:34 PM Healthy
DB03\EXMB01 Healthy 0 0 3/28/2015 6:17:26 PM Failed
DB02\EXMB01 Healthy 0 0 3/28/2015 6:15:19 PM Healthy
DB01\EXMB01 Healthy 0 1 3/28/2015 6:17:40 PM Healthy
[PS] C:\Windows\system32>Get-MailboxDatabaseCopyStatus -server EXmb01 | where {$_.contentindexstate -like "Failed"}
Name Status CopyQueue ReplayQueue LastInspectedLogTime ContentIndex
Length Length State
---- ------ --------- ----------- -------------------- ------------
DB03\EXMB01 Healthy 0 0 3/28/2015 6:17:26 PM Failed
[PS] C:\Windows\system32>Get-MailboxDatabaseCopyStatus -server EXmb01 | where {$_.contentindexstate -like "Failed"}
| Update-MailboxDatabaseCopy -catalogonly
[PS] C:\Windows\system32>Get-MailboxDatabaseCopyStatus -server EXmb01 | where {$_.contentindexstate -like "Failed"}
[PS] C:\Windows\system32>