Calling a WMI Method

The main purpose of WMI is to provide access to classes and instances that represent objects on your network. These classes and instances are supported by providers. For example, all of the instances that represent standard hardware devices on your enterprise, such as
Win32_PhysicalMemory or
Win32_Printer, are supported by the Win32 provider. Similarly, you can access the event log through the Event Log provider, and the registry through the Registry provider.

The methods that WMI implements in interfaces such as
IWbemServices or scripting objects such as
SWbemServices, are primarily for generically obtaining and manipulating data supplied by any provider. For example, use
SWbemServices.InstancesOf to obtain all the instances of
Win32_Process in a subset of enterprise computers. You can then call the Win32 provider method
GetOwnerSid on each
Win32_Process object.

In the following example, the
GetOwnerSid method is called as an automation method on the Process object. A WMI method, such as the
Path_ method defined for
SWbemObject could also be called on the Process object.