Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Method

RunWmiInstanceMethod

ModuleNativeServices
LibraryCore
Action


Excerpt
Run a WMI object method.


Parameters

Namespace (string; optional, default "root\cimv2"): The WMI namespace to use, e.g. "root\ccm".

Query (string): WMI query to select the object(s) to run the method on.
Method (string): The name of the WMI method to run.

Multiexcerpt include
MultiExcerptNameAsUser
PageWithExcerptMethod Notes

Note
For AsUser to work with TIMS/TAIL/Loadgen there must either be a 1E.Client.exe in the same directory as the TIMS/TAIL/Loadgen executable or an installed 1E Client.

Available from v5v8.30.

AllInstances (boolean): Whether to run the method on all object instances (if there is more than one) or just the first.
Additional parameters for the specific method call. Their names are prefixed with "Param_".
Return values

The accumulated output, if any, from the method invocation(s).

Example


Code Block
languageperl
NativeServices.RunWmiInstanceMethod(Namespace:"root\\cimv2", Query:"SELECT * FROM Win32_Process WHERE Name = 'notepad.exe'", AllInstances:true, Method:"Terminate", Param_Reason:"1");


Platforms
  • Windows
Notes

Unlike the recommendation described for the RunWmiQuery method, "SELECT *" must usually be specified in the query otherwise the WMI objects produced by the filter will be incomplete and the WMI method will fail if it requires objects to work on.

...