Connecting to WMI Using the WMI Moniker

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

The WMI scripting library provides two distinct mechanisms you can use to establish a connection to WMI on a local or remote computer: the SWbemLocator object (part of the WMI scripting library) and the WMI moniker, "winmgmts:". Other than general usage and syntax differences, the capability that separates the two connection mechanisms is that SWbemLocator lets you specify user and password credentials to be used to establish the connection, and the WMI moniker does not. SWbemLocator is discussed in more detail in the "WMI Scripting Library" section of this chapter.

The WMI moniker enables you use just one line of code to concisely describe a WMI object or collection of WMI objects to manage. However, with power comes the difficulty of constructing complex WMI moniker strings. The following sections of this chapter decipher the components you can use to construct WMI monikers and look at some best practices for writing WMI scripts that use WMI monikers.


send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net