Applies to: Exchange Server 2007
Topic Last Modified: 2007-06-05

Use the Test-ExchangeSearch cmdlet to test that search is currently enabled and is indexing new e-mail messages in a timely manner.

Syntax

Test-ExchangeSearch [-Identity <MailboxIdParameter>] [-DomainController <Fqdn>] [-IndexingTimeout <Int32>] [-MonitoringContext <$true | $false>]
Test-ExchangeSearch [-DomainController <Fqdn>] [-IndexingTimeout <Int32>] [-MonitoringContext <$true | $false>] [-Server <ServerIdParameter>]
Test-ExchangeSearch [-DomainController <Fqdn>] [-IndexingTimeout <Int32>] [-MonitoringContext <$true | $false>]

Parameters

Parameter Required Type Description

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name (FQDN) of the domain controller that retrieves data from the Active Directory directory service, include the DomainController parameter in the command.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The Identity parameter specifies the recipient that you want to test the search against. If this parameter is not specified, the System Attendant mailbox is used.

IndexingTimeout

Optional

System.Int32

The IndexingTimeout parameter specifies the maximum amount of time to wait between adding the new e-mail message to the test mailbox and waiting for it to be returned in a search result. The default value is 2 minutes. If this parameter is not specified, the default interval is used.

MonitoringContext

Optional

System.Boolean

The MonitoringContext parameter specifies an XML output file to write to for Microsoft Operations Manager.

Server

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The Server parameter specifies the Exchange server of the recipient that you want to test the search against.

Detailed Description

The Test-ExchangeSearch cmdlet creates a message and attachment that only the Microsoft Exchange search can find. Unless a mailbox is specified in the Identity parameter, the message is stored in the System Attendant mailbox. The command waits for the message to be indexed and then searches for the content. The command reports success if the message content is found. The command reports failure if the content is not found after the interval set in the IndexingTimeout parameter has elapsed.

To run the Test-ExchangeSearch cmdlet, the account you use must be delegated the following:

  • Exchange Recipient Administrator role

  • Exchange Server Administrator role and local Administrators group for the target server

For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.

Input Types

Return Types

Errors

Error Description

Exceptions

Exceptions Description

Example

This example tests whether search is enabled for the user, John@contoso.com.

Copy Code
Test-ExchangeSearch -Identity john@contoso.com