Handy way to restart downed Exchange Services (and only the ones you need)
Here's a quick Powershell one-liner to start up all the necessary Exchange Services for any given role.
Test-ServiceHealth | Select-Object -Expand ServicesNotRunning | Start-Service
There is also the old standby:
Get-Service *Exchange* | Start-Service
But that one can start unnecessary services (set to manual) like the Exchange Pop3 and Imap4 service.
Just thought it'd make and interesting post because not too many people know about the Test-ServiceHealth cmdlet.
Comments
- Anonymous
January 20, 2011
Stupid question. does this cmdlet start services or restart services? asking since we have an exchange that likes to go down alot and trying to find easy way to restart the services and bring it back up. currently doing manually. - Anonymous
February 28, 2014
No follow up? His question is old. . . - Anonymous
February 28, 2014
Ah, sorry. Missed this. It starts them, not restarts them. Also, this cmdlet is no longer valid in Exchange 2013. - Anonymous
May 20, 2016
Awesome! I once saw another one-liner that did this, but it used a For each where eq construct. This is way better. Simple and to the point.