This site will undergo a maintenance outage on Saturday, 13 September beginning at 2:30 AM Central/1 PM IST for a platform upgrade. The downtime will be ~three hours.

This documentation supports the 20.08 (12.1) version of BMC Discovery.To view an earlier version of the product, select the version from the Product version menu.

discovery.wmiQuery


discovery.wmiQuery(target, query, namespace)

Performs a WMI query on a Windows computer.

 Returns a list of DiscoveredWMI nodes.

Where:

  • target, where target is:
  • query – the WMI query performed on the target
  • namespace – the WMI namespace to query, for example, root/cimv2. Used with the class_name to identify objects of interest.

The following sample code from the Adobe.AcrobatElementsServer pattern module shows the usage of the function:

constants
        ...
        wmiNS := raw 'root\CIMV2';
end constants;
...

...
body
         host := model.host(process);
 ...
         // WMI query versioning
         cmd := text.replace(process.cmd, "\\", "\\\\");
         wmiQuery := "SELECT Version FROM CIM_DataFile where Name='%cmd%'";
         wmi_results := discovery.wmiQuery(host, wmiQuery, wmiNS);
         ...
end body;

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*