PowerShell script to find status of service on a remote computer


Here's a quick one-liner to retreive the status of a Windows service on a remote computer using Powershell. You don't need PowerShell remoting for this to work because it uses WMI.

This example uses the SNMP service, so just replace that text with the particular service you're looking for. Also replace remotecomputer with the name of the computer you are querying. If you remove '-computername remotecomputer' you will query your local computer.

Get-WmiObject -Class win32_service -ComputerName remotecomputer| ? { $_.name -like "snmp" } | % { "$($_.name) is $($_.state)" }

Isn't PowerShell great?!