Applications Systems
AppInsight for Exchange: Search-Mailbox cmdlet and indexing
This article discusses AppInsight for Exchange: Search-Mailbox cmdlet and indexing
First published date
Last published date
Overview
Product section
Resolution
In order to utilize the Search-Mailbox cmdlet using -SearchQuery filters, Content Indexing (CI) must be enabled and the service must be running. AppInsight for Exchange uses this to determine attachment size and count. To query this information, use the following commands:
Get-MailboxDatabase | Where-Object {$_.IndexEnabled -eq $False} | Select-Object Identity
DB's with indexing enabled:
Get-MailboxDatabase | Where-Object {$_.IndexEnabled -eq $True} | Select-Object Identity
2010 Search Service not running:
Get-Service -Name "MSExchangeSearch" | Where-Object {$_.Status -ne "Running"}
2010 Search Service is running:
Get-Service -Name "MSExchangeSearch" | Where-Object {$_.Status -eq "Running"}
2013 Search Service not running:
Get-Service -Name "MSExchangeFastSearch" | Where-Object {$_.Status -ne "Running"}
2013 Search Service is running:
Get-Service -Name "MSExchangeFastSearch" | Where-Object {$_.Status -eq "Running"}
If the status of the CI is any other than Healthy or Seeding, use of the Search-Mailbox cmdlet will be affected. If you encounter a database with indexing disabled, run the following command to enable it:
Set-MailboxDatabase -Identity "<db_name>" -IndexEnabled $true</db_name>
If all databases on a server have indexing disabled, use the following command:
Get-MailboxDatabase -Server "<server_name>" | Set-MailboxDatabase -IndexEnabled:$True</server_name>
If the search service is not running on Exchange 2010, execute the following commands:
Set-Service MSExchangeSearch -StartupType Automatic Start-Service MSExchangeSearch
If the search service is not running on Exchange 2013, execute the following commands:
Set-Service MSExchangeFastSearch -StartupType Automatic Start-Service MSExchangeFastSearch
If the Content Index of the active database copy is not healthy, take the following actions:
- Stop the search service
- Delete the CI files
- Restart the search service on the server.
Note: The Content Index state of passive copies do not affect the performance of the Search-Mailbox cmdlet, but should be addressed if not in a Healthy or Seeding state.