Commands › Exchange Online

Test-ExchangeSearch

Exchange Online ExchangeOnlineManagement Test-*

Test that Exchange Search is currently enabled and is indexing new email messages in a timely manner.

Quick start script

# Test-ExchangeSearch — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Test-ExchangeSearch | Format-List

# 3. Export for evidence / drift tracking
Test-ExchangeSearch | Export-Clixml .\ExchangeSearch-$(Get-Date -Format yyyyMMdd).xml

Syntax — 3 parameter sets

Identity

Test-ExchangeSearch [[-Identity] <MailboxIdParameter>]
 [-Archive]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-IndexingTimeoutInSeconds <Int32>]
 [-MonitoringContext]
 [-WhatIf]
 [<CommonParameters>]

Database

Test-ExchangeSearch [-MailboxDatabase <DatabaseIdParameter>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-IndexingTimeoutInSeconds <Int32>]
 [-MonitoringContext]
 [-WhatIf]
 [<CommonParameters>]

Server

Test-ExchangeSearch [-Server <ServerIdParameter>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-IndexingTimeoutInSeconds <Int32>]
 [-MonitoringContext]
 [-WhatIf]
 [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-Identity MailboxIdParameter The Identity parameter specifies the mailbox that you want to test Exchange Search against. You can use any value that uniquely identifies the mailbox. For example:
-Archive SwitchParameter The Archive switch specifies that the test is run against the archive mailbox for the mailbox user specified by the Identity parameter. You don't need to specify a value with this switch.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-IndexingTimeoutInSeconds Int32 The IndexingTimeoutInSeconds parameter specifies, in seconds, the maximum amount of time to wait between adding the new email message to the test mailbox and waiting for it to be returned in a search result. The...
-MailboxDatabase DatabaseIdParameter This parameter is functional only in Exchange Server 2010 and 2013.
-MonitoringContext SwitchParameter The MonitoringContext switch includes the associated monitoring events and performance counters in the results. You don't need to specify a value with this switch.
-Server ServerIdParameter The Server parameter specifies the Exchange server for the recipient that you want to test Exchange Search against. You can use any value that uniquely identifies the server. For example:
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.