Test-ServiceHealth – 1 Of 28 Test Cmdlets In Exchange 2010 SP1…

MS Exchange

Test-ServiceHealth – the cmdlet name speaks for itself. I was at a customer site yesterday and the fact that the 3rd line engineers didn’t know anything about the test cmdlets in Exchange 2010 has motivated me to write a series of 28 articles, describing each test cmdlet, what it does and how to use it. The first one that comes to my mind is Test-ServiceHealth, a very essential & easy tool to check whether your Exchange services are running as expected.

Test-ServiceHealth cmdlet checks the state of the Exchange services running on the server and outputs whether all the required services are running or not. If a service is not running, it will show you which one it is. If you have a server with different roles, it will check the services for each role and report based on the roles.

Test-ServiceHealth Cmdlet

Though the cmdlet outputs everything we need, we can customize the syntax with exactly what we need (to know whether all required services are running). Test-ServiceHealth | ft Role, RequiredServicesRunning –autosize gives you a better output.

Formatted test-servicehealth better output

You can query the service state on a different server by specifying the server name after the “server” parameter. The syntax is Test-ServiceHealth –Server servername | ft Role, RequiredServicesRunnning –autosize.

Test-ServiceHealth Server Remote

What if you want to see whether the required services are running on all servers you have? The cmdlet doesn’t output the server name and hence a small script is required.

$servers = Get-ExchangeServer

ForEach ($server in $servers) { Write-host “Server Name is” $server.name; Test-ServiceHealth $server | ft Role, RequiredServicesRunnning –autosize }

Test-ServiceHealth Small Script

Other Popular Articles


MS Exchange

Scripting Agent Initialization Failed: “File is not found” Error During Exchange 2016 Setup

MS Exchange

EAC Access While Co-Existing Exchange 2013 With 2010

MS Exchange

Delete All Calendar Entries In An Exchange 2010 Mailbox

1 thought on “Test-ServiceHealth – 1 Of 28 Test Cmdlets In Exchange 2010 SP1…”

  1. Hello Sir,

    I ran the above command in my environment, but it does not display the Requiredservices running as True or False. Its just blank. Could you please advise?

    $servers = Get-ExchangeServer

    ForEach ($server in $servers) { Write-host “Server Name is” $server.name; Test-ServiceHealth $server | ft Role, RequiredServicesRunnning –autosize }

    Reply

Leave a Comment