Get WMI Object

Returns the __PATH property of a WMI class.

Privileges

Normal

Input Parameters

Name Type Required Description
Namespace String Yes The namespace for the WMI class, default value is root\cimV2.
WMI Class String Yes The name of a WMI class (for example, Win32_OperatingSystem).
Filter String Yes Filter to aid in the class search.

Output Parameters

Name Type Description
ResultObject String The __PATH property of the selected class.
Result Number Returns a success value of zero or any value other than zero to indicate failure.

Example Input Parameters

Name Type Required Example

Namespace

String

Yes

root\CIMV2

WMI Class

String

Yes

win32_service

This will query WMI for all Windows Services referenced in the w32_Service.

Filter

String

Yes

StartMode = "Auto"

This will query WMI for all Windows Services referenced in w32_Service that have a startup type of Auto

StartMode = "Auto" and State = "Running"

This will query WMI for all Windows Services referenced in w32_Service that have a startup type of Auto and current state of the Windows Service is Running

Name like "Windows Software Probe%"

This will query WMI for all Windows Services referenced in w32_Service that have a Name that begins with “Windows Software Probe”

FILTER OPERATORS

Operator

Description

=

Equal

!

Not equal

<>

Not equal

<

Less than

<=

Less than or equal

>=

Greater than or equal

LIKE

Wildcard match

IS

Evaluates null

ISNOT

Evaluates not null

ISA

Evaluates a member of a WMI class