August 2, 2014

Recreating failed content index state on multiple databases.

This can be used if you find that multiple or all databases are in failed content index state. This is especially handy if you have many databases (for example 50 databases) and lag copy servers and databases.

.\RedistributeActiveDatabases.ps1 -DagName USDAG001 -BalanceDbsByActivationPreference –Confirm:$false” -ShowFinalDatabaseDistribution               
               
Restart the indexer service on all of the MBX servers if it is complaining about failed content state for multiple (or all) databases           
               
Check that they are mounted correctly and index is in a healthy state for each MBX server.        
               
Get-MailboxDatabaseCopyStatus -Server NYCS001 | where {$_.status -eq "mounted"}               
               
Name                         Status     CopyQueueLength    ReplayQueueLength    ContentIndexState
USDB023\NYCS001     Mounted    0    0    Healthy
USDB021\NYCS001    
Mounted   0    0    Healthy
USDB019\NYCS001     Mounted    0    0    Healthy
USDB017\NYCS
001     Mounted    0    0    Healthy
USDB015\NYCS001     Mounted    0    0    Healthy
               
               
Set the lag servers auto activation to blocked via this cmdlet:      
               
Set-Mailboxserver -Identity NYCS003 -DatabaseCopyAutoActivationPolicy Blocked               
Set-Mailboxserver -Identity NYCS006 -DatabaseCopyAutoActivationPolicy Blocked   
           
               
Remove all database copies on both lag servers using the Exchange console (EMC), but you could also use a powershell command:       
               
Add-MailboxDatabaseCopy -Identity USDB001 -MailboxServer NYCS003 -ActivationPreference 5 -ReplayLagTime 5.00:00:00               
         
Add-MailboxDatabaseCopy -Identity USDB001 -MailboxServer NYCS006 -ActivationPreference 6 -ReplayLagTime 5.00:00:00               
               
Check replication and you can see that it is no longer complaining about cluster network.
               
Test-ReplicationHealth -Identity nycs001               
               
Server         Check                      Result     Error               
------          -----                      ------     -----               
NYCS001    ClusterService             Passed               
NYCS001    ReplayService              Passed               
NYCS001    ActiveManager              Passed