Monitor Windows Services

Problem:

I need to monitor the installed services and their status. I.E. if they are started or stopped.
I will take the data and use a separate script to make alert notifications.

Here are a couple of ways to do this.

Powershell:

Get-Service | select DisplayName, Name, Status | sort status -Descending | Export-Csv -Path $env:COMPUTERNAME".xls"

Command Line:

sc query

Note:

There is quite a bit of difference in the above output, I personally use the PowerShell example.

Leave a Reply