WMI integration

You can invoke any Windows Management Instrumentation (WMI) query directly from a PowerShell cmdlet. Because the 1E Platform handles the transport and execution of the underlying instruction, you do not need to have enabled WinRM to use this functionality.

You can invoke a WMI query by using the invoke-1EWmiquery cmdlet. The following invokes the specified WMI query against the namespace defined:

Copy
Invoke-1EWMIQuery -Query <query> -Namespace <namespace> -TargetScope <scope>|-TargetFqdns <fqdn list>

For example:

Copy
Invoke-1EWMIQuery -Query "select CommandLine from win32_process" -namespace "root\cimv2" -targetscope urth

Note the following:

  • This cmdlet uses the support instruction 1E-Exchange-ExecuteWMIQuery, which is included with the 1E PowerShell Toolkit. You must upload this instruction to the 1E Platform before using this cmdlet.
  • This cmdlet requires platform version 5.1 or later. It will throw an exception if it is run against an older version of the 1E Platform.
  • An invalid WMI query or namespace will not cause an error. Instead, the device or devices that are unable to execute the query (for example, because the namespace is not valid on that device) will return no data.