If you need to verify all Windows services for Exchange are running (ie after rebooting or patching), there is a built-in Exchange Management Shell cmdlet to quickly identify if all services are running and display the ones that aren't entitled Test-ServiceHealth. Example from Exchange 2013:
[PS] C:\scripts>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, MSExchangePOP3, 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 : {}
This cmdlet is great to identify which (if any) services aren't running, but you're still forced to manually start any stopped services. A script is saved here written to run the Test-ServiceHealth cmdlet and start any services it reports as not running. To run the script, follow these instructions:
- Save the .txt file as .ps1 and transfer to the Exchange server you're working on
- Run Exchange Management Shell as administrator and change directory to the location of the Check-ExchangeServices.ps1 file
- Example - if you saved the Check-ExchangeServices.ps1 under c:\scripts, then you would need to run this command to change directory to that location:
- cd c:\scripts
- Example - if you saved the Check-ExchangeServices.ps1 under c:\scripts, then you would need to run this command to change directory to that location:
- Run the script by prepending .\ to the file name and press Enter
- Example - .\Check-ExchangeServices.ps1