Win2000 automation management implementation

  

One of the advantages of Windows 2K/XP is that it has better manageability than before. For example, it supports the remote management mode under Windows 2000 Server Terminal Services, supports Microsoft Management Console (MMC), and one of them supports WMI. WMI is an acronym for Windows Management Instrumentation, the Windows Management Instrumentation. WMI has many uses, one of which is management automation through scripting.

First, why use a script?

Looking back at the 1990s, one of the reasons why Windows NT was successful was that it was relatively easy to use. Anyone who can use Windows 3.1 can manage a simple NT network. It sounds a little weird today, but the truth is that NT 3.1 is much less functional than Windows 2K/XP and therefore much simpler). Just look at NT's control panel, and this is roughly an impression of what you can do.

With the development, the original friendly interface has become more friendly. In Windows 2K/XP, almost every operation has a wizard, each level of the object has a graphical property page; different operation options guide you to the final task dialog, MMC allows you to use commonly used tools (even third-party tools) plugged into a customized tool set.

However, GUIs that are friendly to advanced users are too cumbersome. In addition, although some tasks can be performed on the command line, the command line does not have the full functionality of a graphical tool. In order to automate the operation tasks under Windows 2K/XP, a better way is to directly access the management interface accessed by the graphical tools through the script program. WMI allows users to access almost any part of a scripting language through a unified interface. Of course, there are some restrictions on programming WMI with scripts, such as not directly accessing the Win32 API.

Second, what is WMI?

WMI is the core of the Windows 2K/XP management system; for other Win32s, WMI is a useful plugin. WMI is based on CIMOM, the Common Information Model Object Manager, which is an object database that describes the building blocks and provides a common interface for MMC and scripts to access the building blocks. With WMI, different parts of the tool software and script access do not need to use different APIs; instead, different parts can be inserted into WMI, as shown in Figure 1 (the figure comes from MSDN), tool software and WMI can be easily Read and write WMI.

Figure 1

Windows 2K/XP and Windows 98 support WMI; if you add Service Pack 4 or higher for NT 4.0 and Windows 95, NT 4.0 and Win95 also support WMI . Therefore, when using WMI for remote management, you do not have to use Windows 2K/XP (of course, if WMI scripts run on a Win9x machine without Performance Monitor, you cannot query the performance of Windows 2K/XP on a remote Win9x system.

As mentioned earlier, WMI allows access to multiple building blocks through a common interface, so there is no need to treat various underlying interfaces or so-called "providers" separately. WMI can be used to efficiently manage remotes. In contrast to local computers, not all Windows 2K/XP command-line tools support remote operation.

WMI is an implementation of the WBEM model. WBEM is Web-Based Enterprise Management, or Web-based. Enterprise Management, WBEM was created by the DMTF (Distributed Management Task Force) with the help of many vendors, including Compaq, Sun, Microsoft, etc. The goal of WBEM is to develop a standard interface set for managing enterprise environments. The most critical part of the WBEM model is its data model (or the way it describes and defines objects), and the coding specification (Encoding Specification). ), and the mode of transferring data between the client and the server.

The data model of WBEM is CIM (Common Information Model). CIM is a physical and logical unit used to name computers. A standard naming system (or naming pattern), such as a logical partition of a hard disk, an instance of a running application, or a cable.

CIM is an object-oriented model that uses a set of object-oriented objects. The terminology is described. CIM contains a class, which is a template of a managed unit. An instance of a class is called an object, and an object represents a specific unit of the underlying system. A namespace is a collection of classes. Each namespace is oriented to a specific management domain. The class contains properties and methods.

Copyright © Windows knowledge All Rights Reserved