Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1
Topic Last Modified: 2007-07-05

Use the Test-ServiceHealth cmdlet to test whether all the required services that are configured to start automatically on a server have started. The Test-ServiceHealth cmdlet returns an error for any service that is required by a configured role and is set to start automatically but is not currently running.

Syntax

Test-ServiceHealth [-Server <ServerIdParameter>] [-ActiveDirectoryTimeout <Int32>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-MonitoringContext <$true | $false>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

ActiveDirectoryTimeout

Optional

System.Int32

The ActiveDirectoryTimeout parameter specifies the amount of time, in seconds, allowed for each Active Directory directory service operation to complete before the operation times out. The default value is 15 seconds.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm parameter causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You do not have to specify a value with the Confirm parameter.

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.

MonitoringContext

Optional

System.Boolean

The MonitoringContext parameter specifies whether the results of the command will include monitoring events and performance counters. The two possible values for this parameter are $true or $false. If you specify $true, the results will include monitoring events and performance counters in addition to the information about services.

Server

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The Server parameter specifies the server on which you will check that the required services are running. If you do not specify this parameter, the command will check the services on the local server.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf parameter instructs the command to simulate the actions that it would take on the object. By using the WhatIf parameter, you can view what changes would occur without having to apply any of those changes. You do not have to specify a value with the WhatIf parameter.

Detailed Description

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

  • 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 Microsoft Exchange Server 2007, see Permission Considerations.

To run the Test-ServiceHealth cmdlet on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

Input Types

Return Types

Errors

Error Description

 

Exceptions

Exceptions Description

 

Example

In this example, the Test-ServiceHealth command is used without parameters to test the services on the local server.

Copy Code
Test-ServiceHealth