skip to Main Content

Repair failed content index in Exchange

You have a database showing as failed content index in Exchange Server. It can be one or more databases. In this article, you will learn how to repair failed content index in Exchange Server. Good to know is that when you repair a failed content index in Exchange Server, it can cause high CPU utilization on the Exchange Server. It’s important to enable the search indexing after working hours or at an off-peak time as it can impact performance.

Status of the content index

Let’s get the status of the content indexing. Run Exchange Management Shell as administrator. Run the following command.

[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, ContentIndexState

Name            Status ContentIndexState
----            ------ -----------------
DB10-2016\EX01 Mounted           Healthy
DB10-2016\EX02 Healthy           Healthy
DB11-2016\EX01 Mounted           Healthy
DB11-2016\EX02 Healthy           Healthy
DB12-2016\EX01 Mounted           Healthy
DB12-2016\EX02 Healthy           Healthy
DB13-2016\EX01 Mounted            Failed
DB13-2016\EX02 Healthy            Failed
[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, ContentIndexState

Name            Status  ContentIndexState
----            ------  -----------------
DB10-2016\EX01 Mounted            Healthy
DB10-2016\EX02 Healthy            Healthy
DB11-2016\EX01 Mounted            Healthy
DB11-2016\EX02 Healthy            Healthy
DB12-2016\EX01 Mounted            Healthy
DB12-2016\EX02 Healthy            Healthy
DB13-2016\EX01 Mounted             Failed
DB13-2016\EX02 Healthy FailedAndSuspended

You will see one of the following outputs. The database DB13-2016 ContentIndexState is showing Failed or FailedAndSuspended. Let’s rebuild the index.

Stop the services

Stop the services first by running the two commands.

[PS] C:\>Stop-Service MSExchangeFastSearch
WARNING: Waiting for service 'Microsoft Exchange Search (MSExchangeFastSearch)' to stop...

[PS] C:\>Stop-Service HostControllerService
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostcontrollerService)' to stop...

We can stop both services with a one-liner.

[PS] C:\>Get-Service -Name "HostControllerService","MSExchangeFastSearch" | Stop-Service
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostControllerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostControllerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostControllerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search Host Controller (HostControllerService)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search (MSExchangeFastSearch)' to stop...
WARNING: Waiting for service 'Microsoft Exchange Search (MSExchangeFastSearch)' to stop...

Both the services stopped. Proceed with the next steps.

Identify database and remove indexing folder

If you know the database location, go to that folder in Windows Explorer. If you don’t know, you can run the following command. It will show the database folder path.

[PS] C:\>Get-MailboxDatabase "DB13-2016" | Select EdbFilePath

EdbFilePath
-----------
F:\DB13-2016\DB13-2016.edb

Go to the folder F:\DB13-2016\ in Windows Explorer. Delete the Global Unique Identifier (GUID) folder.

Repair failed content index in Exchange delete index folder

The next step is to start the services.

Start the services

Start both the services with the first two commands or use the third command as a one-liner.

[PS] C:\>Start-Service MSExchangeFastSearch

[PS] C:\>Start-Service HostControllerService

[PS] C:\>Get-Service -Name "HostControllerService","MSExchangeFastSearch" | Start-Service

Both the services started. It will create a new GUID folder in the directory F:\DB13-2016\.

Check the status of the indexing

Give it a few minutes before checking the status. Run the following command.

[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, ContentIndexState

Name            Status  ContentIndexState
----            ------  -----------------
DB10-2016\EX01 Mounted            Healthy
DB10-2016\EX02 Healthy            Healthy
DB11-2016\EX01 Mounted            Healthy
DB11-2016\EX02 Healthy            Healthy
DB12-2016\EX01 Mounted            Healthy
DB12-2016\EX02 Healthy            Healthy
DB13-2016\EX01 Mounted           Crawling
DB13-2016\EX02 Healthy FailedAndSuspended

Database DB13-2016 Content Index State is showing that it is Crawling. It can take some time before it finishes the crawling. Do you like to have an estimate of the mailboxes remaining? Read more on how to monitor Exchange database index state crawling. After it finishes the crawling, it will change to a Healthy state. The FailedAndSuspended will also change to a Healthy state.

[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, ContentIndexState

Name            Status ContentIndexState
----            ------ -----------------
DB10-2016\EX01 Mounted           Healthy
DB10-2016\EX02 Healthy           Healthy
DB11-2016\EX01 Mounted           Healthy
DB11-2016\EX02 Healthy           Healthy
DB12-2016\EX01 Mounted           Healthy
DB12-2016\EX02 Healthy           Healthy
DB13-2016\EX01 Mounted           Healthy
DB13-2016\EX02 Healthy           Healthy

Conclusion

In this article, you learned how to repair failed content index in Exchange Server. It’s important to repair the search indexing after working hours or at an off-peak time as it can impact performance. If you enjoyed this article, you may also like Outlook keeps asking for password after migration. Don’t forget to follow us and share this article.

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 One Comment

Leave a Reply

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

Back To Top