We are upgrading Exchange 2016 CU20 to Exchange 2016 CU21. That's because updates for Exchange…
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 essential to enable search indexing after working hours or at an off-peak time as it can impact performance.
Table of contents
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.
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.
[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 shows the content index state Crawling. It can take some time before it finishes 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 crawling, it will change to a Healthy status. The FailedAndSuspended content index state will also change to Healthy.
[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.
Did you enjoy this article? You may also like Activate database copy failed content index disabled. Don’t forget to follow us and share this article.
Hi
I have this Problem
Name Status CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState
—- —— ————— —————– ——————– —————–
MailDB01\EXG4 Mounted 0 0 NotApplicable
MailDB02\EXG4 Mounted 0 0 NotApplicable
how to make them healthy
thanks
This behavior changed on Exchange Server 2019. The ContentIndexState shows as NotApplicable when you run the commands in Exchange Management Shell.
Read more: Exchange Server Content index state: NotApplicable.
Do you have a version that works with Exchange 2019?
The GUID file doesn’t exist in 2019.
It’s changed since Exchange Server 2019, and there is no GUID file. As a result, the ContentIndexState shows as NotApplicable when you run the commands in Exchange Management Shell.
Read more: Exchange Server Content index state: NotApplicable.
my search database fails repeatedly. I create a test database with no mailboxes in it and within 4 hours it has failed, as I said, with no mailboxes in it. your process doesn’t even survive the crawled state and never gets a searchable mailbox. So what to do?
ME to!
Tnx Dear Ali