Windows Script Host-based applications and scripts work in Windows Management Instrumentation (WMI) through the WMI Object Model, which defines the programming interface to WMI. A number of WMI object types are used when manipulating Configuration Manager 2007 objects. For more information about the WMI Object Model, see the http://go.microsoft.com/fwlink/?linkid=31917.
In simple Configuration Manager scripts, you use the following WMI object types:
|Understanding WMI Query Language (WQL) queries is very
important for identifying which Configuration Manager objects you
want to read. WQL statements allow you to retrieve Configuration
Manager objects that are based on SQL-like queries. For example,
the following WQL statement is used to identify all Windows
Server 2003 systems:
For more information about using VBScript and WMI, see How to Use Configuration Manager Objects with WMI.
The http://go.microsoft.com/fwlink/?LinkId=44208 object is used to create an authenticated connection to the SMS Provider. You use http://go.microsoft.com/fwlink/?LinkId=44210 method to make the connection to the SMS Provider. This method is particularly useful if you need to pass user credentials to a remote Configuration Manager server during connection. You can also use the Windows Script Host http://go.microsoft.com/fwlink/?LinkId=43953 method to create an authenticated connection. The type of object that is returned by GetObject depends on the parameters that are passed to it. See How to Connect to an SMS Provider in Configuration Manager by Using Managed Code and How to Connect to an SMS Provider in Configuration Manager by Using WMI for examples that show how to use either SWbemLocator or GetObject in your connection script.
The http://go.microsoft.com/fwlink/?LinkId=44211 object represents an authenticated connection to a SMS Provider, and it is the object that you use to retrieve Configuration Manager objects. You receive an SWbemServices object as the return value of the SWbemLocator function ConnectServer or, alternatively, as the return value when the GetObject method is used to connect to the SMS Provider. SWbemServices has several methods, but you use only the http://go.microsoft.com/fwlink/?LinkId=44213, http://go.microsoft.com/fwlink/?LinkId=44215, and http://go.microsoft.com/fwlink/?LinkId=44214 methods for retrieving objects.
Get returns a single instance of a Configuration Manager object (SWbemObject). ExecQuery and InstancesOf return Configuration Manager objects in a collection (SWbemObjectSet) of Configuration Manager objects.
The http://go.microsoft.com/fwlink/?LinkId=44216 object represents a collection of Configuration Manager objects. You can use it to enumerate through the collection and read individual instances of the Configuration Manager object (SWbemObject) that you are interested in. You typically get a SWbemObjectSet object returned to you from the SWbemServices retrieval functions.
The SWbemObject object allows you to access the properties and other information for a Configuration Manager object.
Send comments about this topic to Microsoft.