The Test-ServiceHealth PowerShell cmdlet will check that the required services for the Exchange Server 2013 roles installed on a server are running. This includes services that Exchange itself installs, as well as those in the operating system that Exchange depends on.

For servers installed with only the Client Access server role please note this bug.

Running Test-ServiceHealth on a server will check the services on the local server.

[PS] C:\>Test-ServiceHealth

Role                    : Mailbox Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeDelivery, 
                          MSExchangeIS, MSExchangeMailboxAssistants,     
                          MSExchangeRepl, MSExchangeRPC, MSExchangeServiceHost,
                          MSExchangeSubmission, MSExchangeThrottling, 
                          MSExchangeTransportLogSearch, W3Svc, WinRM}
ServicesNotRunning      : {}

Role                    : Client Access Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, 
                          MSExchangeMailboxReplication, MSExchangeRPC,
                          MSExchangeServiceHost, W3Svc, WinRM}
ServicesNotRunning      : {}

Role                    : Unified Messaging Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeServiceHost, 
                          MSExchangeUM, W3Svc, WinRM}
ServicesNotRunning      : {}

Role                    : Hub Transport Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeEdgeSync, 
                          MSExchangeServiceHost, MSExchangeTransport, 
                          MSExchangeTransportLogSearch, W3Svc, WinRM}
ServicesNotRunning      : {}

You will notice that the server roles in the output above do not align with the new server role architecture of Exchange Server 2013. This may change in a future version of the cmdlet, but for now you can still use the results to identify required services that are not running.

Test-ServiceHealth can also be run against remote servers.

[PS] C:\>Test-ServiceHealth -Server E15MB3

If a required service is not running you will see the RequiredServicesRunning result set to False, and the ServicesNotRunning result will list the names of the services.

[PS] C:\>Test-ServiceHealth -Server E15MB3

Role                    : Mailbox Server Role
RequiredServicesRunning : False
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeDelivery, 
                          MSExchangeIS, MSExchangeMailboxAssistants, 
                          MSExchangeRepl, MSExchangeRPC, MSExchangeServiceHost,
                          MSExchangeSubmission, MSExchangeThrottling, 
                          MSExchangeTransportLogSearch, WinRM}
ServicesNotRunning      : {W3Svc}

You can quickly start a service using Invoke-Command to issue the command to the remote server.

[PS] C:\>Invoke-Command -ComputerName E15MB3 {Start-Service W3Svc}

Tip: If the service that is not running is WinRM then PowerShell remoting will not work, so you will need to log on directly to the server or use the Services management tool to remotely connect.

[adrotate banner=”48″]

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Tim

    Worked great on Exchange 2016

  2. salih

    hi,
    this week I get same error from report.I chechek it win RM service that it running.
    when I check other exc. services , ı notice that Microsoft Exchange EdgeSync is not runing.
    I started it and then test-servicehealth cmd .I see that everything is OK.

  3. clifford

    HI I am running exchange 2016

    I ran the script and get Mailbox server role services fail

    and
    Mailbox server roles services fail

  4. Francho

    Hi, I can’t find the Test-ServiceHealth command

    There is a list of modules content and how to import it.

    Thank you

  5. Terry

    You forgot adding the point that the command Test-ServiceHealth should be ran within Exchange Management shell.

  6. Marcin

    Hi Paul,

    Unified Message Service fails on one of the exchange servers. I am not able to invoke MSExchangeUM service. It fails with “Failed to start Service “Microsfot Exchange Unified Messaging. OpenError (System.ServiceProcess.ServiceController:ServiceController)”

    I rebooted the server to no avail. Do you have any suggestions?

    Thank you,
    Marcin

  7. Gibra

    Hi how can I disable EDGE service status test?
    I’m not using EGDE role and script is giving error output for HUB transport role because “MSExchangeEdgeSync” is stopped.

    thanx in advance.

  8. Benoit

    Hello,

    We a problem with our exchange server 2013.
    The Microsoft Transport Log Search takes high cpu (60%). We have to reboot the service every 4 hours.

    How to resolve this issue ?

    Thanks for help

      1. Benoit

        Thanks for your answer but how to check if searches or queries running ?

  9. Pistol

    Hi!

    Thanks for the great script. I have a prolem though. If i use the -serverlist parameter it seems the output gets screwed up. I mean the installed roles and other parameters are incorrect.

    For example this is correct:

    [PS] C:inetpubwwwroot>.Test-ExchangeServerHealth.ps1 -server voexc04w -log -reportmode:$true
    Initializing…
    —— Checking voexc04w
    DNS Check: Pass
    Ping Check: Pass
    Uptime (hrs): 242
    Server version: Exchange 2010
    Roles: ClientAccess, HubTransport
    Client Access Server Role Services: Pass
    Hub Transport Server Role Services: Pass
    Total Queue: 106
    —— Finishing
    Done.

    This is NOT (note the serverlist file contains the same server):

    [PS] C:inetpubwwwroot>.Test-ExchangeServerHealth.ps1 -serverlist C:inetpubwwwrootserverlist.txt -log -reportmode:$true
    Initializing…
    —— Checking voexm04w
    DNS Check: Pass
    Ping Check: Pass
    Uptime (hrs): 1121
    Server version: Exchange 2010
    Roles: Mailbox
    Mailbox Server Role Services: Pass
    Mailbox databases mounted: Pass
    MAPI connectivity: Success
    Mail flow test: *FAILURE*
    —— Finishing
    Done.

    I cant seem to find the cause. Any help is much appreciated
    Thanks in advance,
    Pete

    1. Pistol

      Sorry, my mistake. Its really late at work:)

  10. Jason

    Great site.

    This also works on Exchange 2010 SP2

  11. Bandi

    I’m in an Exchange 20072013 coexistence. Exchange 2007 SP3 and Exchange 2013 CU2. The Transport Services won’t start on the Exchange 2013 server.

Leave a Reply