Powershell – Email notification when automatic service is not started (Windows Server 2012 R2)

emailpowershellservicewindows-server-2012-r2

We have a few servers (Windows Server 2012 R2) in our environment that install updates automatically and restart after that.

After the restart we would like to check the status of all the (Windows) services which are set to automatic start. If a service did not start, the script would try to start the service 3 times and if all attempts fail, it should send an email notification so that we can check what's wrong with this service on this server.

I was wondering if there already existed an easy solution, maybe a PowerShell script?

Best Answer

I would advise you to look into getting a NMS. We use PRTG and it works well. In it you can create sensors that monitors windows services using WMI. You can configure the sensor to send mail/start scripts if the service go down.

PRTG is licensed by sensors, but the free version gives you 100, which should be enough for a couple of servers (You need one sensor per service to monitor)

Related Topic