Manage Learn to apply best practices and optimize your operations.

Top Windows command-line commands


Query the status of services with sc query state= all

Source:  iStock/RUSSELLTATEdotCOM
Visual Editor: Sarah Evans/TechTarget

Anytime you want to know what services are installed on a computer and find out which ones are active, you can use sc query state= all to find a complete list. If the computer in question is remote, you should use sc \\computername query state= all.

If you're looking for a specific service, you can use sc query service_name. To find the configuration information for a specific service, you can use sc qc service_name. To stop a particular service from running on a computer, use sc \\computername stop service_name. And if you have to start a service on a computer, you can use sc \\computername start service_name.

Another query command that can come in handy if, for example, you have to see the results of a security audit is auditpol /get /category:*.With this command, you can ask for and establish audit settings on a local computer.  To see the same results in CSV format you can use auditpol /get /category:* /r.

View All Photo Stories

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

How often do you perform security audits?
Another way to achieve this is to use WMI Query, PowerShell script or wmic tool.

PowerShell is really powerful. You can use it to query services from all remote computers in your domain, filter and sort list of services.

For example, this is how you can get list of all services in your AD domain:
Get-ADComputer -Filter {OperatingSystem -Like “Windows 10*”} | ForEach-Object {Get-WmiObject -Class Win32_Service -Computer $_.Name}

More useful examples on this:
How do I enable a remote query with "sc \\server query" when I'm in the admin-group of \\server but do not have logged on (have an existing session)? The "sc \\server" command doesn't specify a user/passwd. 

Is "net user" the way to go?