Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003

Microsoft® Windows® 2000 Scripting Guide

« Previous | Next »   

One point that has been reiterated throughout this chapter is that most WMI scripts follow a simple three-step pattern. In general, WMI scripts:

  1. Connect to the WMI service.
  2. Retrieve a WMI object or collection of objects.
  3. Perform some sort of task on the object or objects. Until now, this task has largely been confined to reporting property values. However, you can also do such things as run methods, configure property values, and create or delete instances.

To become proficient in writing WMI scripts, you need to understand the nuances of these three steps. The preceding section of this chapter was a bit more theoretical in nature: It provided useful background information for understanding what WMI is and what it can do. This portion of the chapter takes a more practical approach; in particular, it provides a detailed look at the three steps used in most WMI scripts. This is done by:

In addition to detailing the three steps in a typical WMI script, this section also looks at two other important elements in script writing: working with WMI dates and times, and monitoring events.


 Send us your feedback « Previous | Next »   

Категории