Providers

Understanding the namespace assists the network administrator with judiciously applying WMI scripting to his or her network duties. However, as mentioned earlier, to access information via WMI, you must have access to a WMI provider. Once the provider is implemented, you can gain access to the information that is made available.

The following script, ListWmiProviders.vbs, enumerates all the WMI providers instrumented on the machine. This information can lead the network administrator to MSDN or some other place to find details about the methods supported by the provider.

strComputer = "." Set objSWbemServices = _ GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colWin32Providers = objSWbemServices.InstancesOf("__Win32Provider") ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.