Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
WMI is perhaps best suited for returning information about a computer; there are literally hundreds of WMI classes that provide information on everything from the services installed on a computer to the events recorded in the event logs to attached peripherals such as printers, monitors, and disk drives.
The amount and variety of information that can be returned by using WMI is, in itself, enough to make scripting an important tool for system administration. What makes the technology even more valuable, however, is the fact that the same basic approach can be used to return information regardless of the source. For example, the script template shown in Listing 6.23 returns information about the services installed on a computer. However, this template can easily be adapted to return information about any other managed resource on the computer.
Listing 6.23 Template for Retrieving and Displaying Resource Properties
|
|
To use this template with other WMI classes:
Wscript.Echo
"Caption
"& objInstance.Caption Wscript.Echo
"Description
"& objInstance.Description
Send us your feedback | « Previous | Next » |