Share via


Applies To: Operations Manager 2007 R2

The Microsoft.Windows.WmiProbe module is a probe action module type that is used to query Windows Management Instrumentation (WMI) for instance data and return the information as a System.PropertyBagData type.


Use this module when you want to query for WMI objects and return the data as one or more System.PropertyBagData elements within a workflow such as a rule or monitor.

Type Definition

<ProbeActionModuleType ID="Microsoft.Windows.WmiProbe" Accessibility="Public">
    <xsd:element name="NameSpace" type="xsd:string" />
    <xsd:element name="Query" type="xsd:string" />


The Microsoft.Windows.WmiProbe module supports the configuration parameters described in the following table.

Parameter Type Overrideable Description




Required parameter. Specifies the WMI namespace within which the module is to run the query.




Required parameter. Specifies the SELECT WMI query to run.

The Namespace parameter must be a valid WMI namespace that is present on the monitored computer, or the module raises an error in the Operations Manager event log.

The namespace should always specify the computer to connect to as part of the string. If a computer is not specified, the workflow reads from the local computer, which does not work for agentless monitoring scenarios. The computer name is most commonly passed to the module that is using the $Target notation.

The following code example shows a fully configured Namespace parameter in a workflow that is targeted at the Microsoft.Windows.Computer class type. This example retrieves data from the root\cimv2 WMI namespace.


There is a two-minute time-out for connecting to the WMI Namespace.

The Query parameter must be a valid WMI query that can be executed against the specified WMI namespace, as shown in the following example:

<Query>select DeviceID from win32_logicaldisk</Query> 

It is possible to reference object properties when you specify the query. The following code is a more complex example that uses the DeviceID property:

<Query>associators of {win32_diskdrive='$Target/Property[Type="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$'} where ResultClass=Win32_DiskPartition</Query>


For performance reasons, it is not advisable to use SELECT * in your WMI queries. Always perform SELECT commands on the required columns.

For more information about how to create WMI queries, see Querying WMI.


The Microsoft.Windows.WmiProbe module is a native module.

The module connects to the specified WMI namespace by calling IWbemLocator::ConnectServer. If the connection succeeds, it receives a pointer to the IWbemServices interface and calls IWbemServices::ExecQuery to run the query.


The errors listed in the following table can occur from within the Microsoft.Windows.WmiProbe module.

Exception Reason


The module failed to connect to the WMI namespace.


The module successfully connected to the WMI namespace after an error.


The module cannot initialize due to wrong configuration parameter data.


The module was unable to convert the input namespace to a local namespace.


The module was unable to perform parameter replacement.


The module failed to issue the query and will not able to receive events.


The module was unable to create a property bag data item from the WMI object data.


The module was unable to enumerate the WMI data.


A large array was returned from the WMI object. This might indicate a misconfigured module.

Module Type Usage


Queries Windows Management Instrumentation (WMI) for event or instance data and returns the information as a System.PropertyBagData type. This module is a trigger-only module.

External Module References

The Microsoft.Windows.WmiProbe module is a member of the modules described in the following table.

Module Type Library Usage



Queries WMI and returns the results as System.Discovery.Data type data.



Queries a WMI namespace as a data source module at a scheduled frequency and returns the results as System.PropertyBagData type data.



Queries WMI in order to retrieve performance data for the specified service.


The Microsoft.Windows.WmiProbe module outputs one or more property-bag data items. The exact properties that are available in the output are dependent on the namespace and query that were specified.

The following code shows an example data item for a C: drive instance of the Win32_LogicalDisk class. This was generated by using the query select _CLASS, Access, Caption, Compressed from Win32_LogicalDisk where DeviceID=’C:’.

<DataItem type="System.PropertyBagData" time="2008-10-26T14:34:39.0657744-07:00" sourceHealthServiceId="B0BE86FA-56AD-1F2E-EE87-8DF72FC53818">
  <Property Name="__CLASS" VariantType="8">Win32_LogicalDisk</Property>
  <Property Name="Access" VariantType="18">0</Property>
  <Property Name="Caption" VariantType="8">C:</Property>
  <Property Name="Compressed" VariantType="11" Type="Boolean">false</Property>

If the query that is specified returns multiple property bag data items, the workflow must be targeting a class that has multiple instances for the data to be used, and the data must have some property in it that can associate the correct property bag with the correct Operations Manager object.

For example, if you are monitoring logical disks and if a monitor is running that executes the query select DeviceID from Win32_LogicalDisk, the DeviceID property of the Operations Manager class type would be matched to the DeviceID WMI property in an expression module to filter out the other instances of logical disks.


The following example shows the Microsoft.Windows.WmiProbe module that is being used in a task that uses a property of the application to get data about the disk drive that the application is installed on:

<Task ID="Microsoft.Samples.GetLogicalDiskData" Accessibility="Internal" Target="Microsoft.Samples.ApplicationX">
  <ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.WmiProbe">
    <Query>select DeviceID from win32_logicaldisk where DeviceID='$Target/Property[Type="Microsoft.Samples.ApplicationX"]/HostDrive$'</Query>



Module Type


Input Type


Output Type