How to get service information with the WMI method using PowerShell?


You can also use the WMI method to get the services information instead of standard command Get-Service.

Command

To get the service information on the server, you need to use WMI class Win32_Service.

Get-WmiObject -Class Win32_Service

Output

ExitCode  : 0
Name      : Browser
ProcessId : 0
StartMode : Manual
State     : Stopped
Status    : OK

ExitCode  : 0
Name      : BTAGService
ProcessId : 1468
StartMode : Manual
State     : Running
Status    : OK

ExitCode  : 0
Name      : BthAvctpSvc
ProcessId : 1460
StartMode : Manual
State     : Running
Status    : OK

ExitCode  : 0
Name      : bthserv
ProcessId : 1480
StartMode : Manual
State     : Running
Status    : OK

Command

You can filter the specific output with Select-Object.

Get-WmiObject win32_Service | Select-Object Name, State, Startmode

Output

Name                                                   State   Startmode
----                                                   -----   ---------
AdobeARMservice                                        Running Auto
AdobeFlashPlayerUpdateSvc                              Stopped Manual
AJRouter                                               Stopped Manual
ALG                                                    Stopped Manual
AppIDSvc                                               Stopped Manual
Appinfo                                                Running Manual
AppMgmt                                                Stopped Manual
AppReadiness                                           Stopped Manual
AppVClient                                             Stopped Disabled
AppXSvc                                                Stopped Manual
AssignedAccessManagerSvc                               Stopped Manual
AudioEndpointBuilder                                   Running Auto
Audiosrv                                               Running Auto
autotimesvc                                            Stopped Manual
AVP20.0                                                Running Auto
AxInstSV                                               Stopped Manual
BDESVC                                                 Stopped Manual
BFE                                                    Running Auto
BITS                                                   Running Auto
Bluetooth Device Monitor                               Running Auto
Bluetooth OBEX Service                                 Running Auto

To get the services on a remote computer(s) using WMI.

Get-WmiObject win32_Service –ComputerName Win7,Test-PC | Select-
Object Name, State, Startmode

Updated on: 22-Jan-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements