Description
Returns the display name and current state (running, stopped, paused, resuming) for each service installed on a computer.
Script Code
strComputer = "." Set objWMIService = GetObject("winmgmts:" & _ "{impersonationLevel=Impersonate}!\\" & _strComputer & "\root\cimv2") Set colServices = objWMIService.ExecQuery & _("SELECT * FROM Win32_Service") For Each objService in colServices Wscript.Echo objService.DisplayName & " = " &_objService.State Next
| Attachment | Size |
|---|---|
| serviceavailibility.txt | 350 bytes |