Get windows services using WMIC

Recently, I was auditing all our servers and one of the task is to check the windows services. I need a list of services that are running so i can compare that with other servers. The below command made it so easy.


To get all services:

(wmic service get name, startname,state /format:htable >output.html) && output.html


To get all running services

(wmic service where 'state like "%running%"' get name, startname,state /format:htable >output.html) && output.html


(wmic service where started=true get  name, startname /format:htable >output.html) && output.html


now i don’t have to tell you what else you can do with this query!!


Happy X’mas and New Year! 🙂