Managing Computer States

Microsoft® Windows® 2000 Scripting Guide

Computers are dynamic entities. The exact configuration and set of resources available on a system are constantly changing. Software is installed and then removed; files are created and deleted; memory is allocated and then released.

Many of these dynamic changes, such as the creation and deletion of temporary files, are of little interest to administrators. Others, however, are of considerable interest. For example, administrators need to know when computers are shut down and restarted. After all, if a server shuts down unexpectedly, the resources provided by that server will be unavailable until it has been restarted.

Likewise, administrators need to know when computers switch from regular power sources to backup power sources. A computer that switches to battery power will be operational only as long as the battery lasts. Steps must be taken to correct the problem before the battery runs out and the computer shuts down.

In addition, administrators typically configure computers so that specific actions are carried out in specific situations. If the power fails, you might want to ensure that a multiple-boot computer is restarted by using a specific operating system. If a server encounters an unrecoverable error, you might want to ensure that a detailed record is made of what the computer was doing at the time the error occurred.

WMI provides a number of classes, properties, and methods that enable administrators to monitor, configure, and, in some cases, trigger changes in computer state. In particular, you can:

  • Manage and configure computer startup settings.

  • Manage and configure computer recovery settings.

  • Monitor computer shutdowns, and remotely shut down or restart a computer.

  • Monitor changes in computer power status (for example, a computer that switches from its primary power source to battery power).