Home > Samples > Update > May 2003
  Windows Administration Moves Beyond GUI    
   

[bio]

The following is the full text of an article published by Directions on Microsoft, an independent research firm focused exclusively on Microsoft strategy & technology. Each month we make one or more key articles available to non-subscribers.

With Windows 2003 Server, Microsoft is reducing Windows Server's reliance on GUI-based administration and is giving more prominence to command-line and script-based administration. Administrators will benefit from this change in direction because they need to monitor and configure the hardware and software resources of multiple desktops, laptops, and servers, and GUI-based administration tools are not as efficient as scripts for some repetitive administration tasks. Administrators will now have powerful non-GUI administration and management alternatives for Windows XP and Windows Server 2003, but leveraging the new alternatives may require training in the new script languages, and better administration-focused editing and debugging tools.

Windows offers several modes of administration: GUI (not discussed in this article), command-line, and two types of scripting—basic-batch and Windows Script Host. (For background, see the sidebar "Windows Administration Modes".) In Windows 2003 Server, administration via command-line, basic-batch scripting, and Windows Script Host-based scripting are more viable because Microsoft has improved and added a number of management technologies, including Windows Management Instrumentation; provided new tools, such as the Windows Management Instrumentation Command Line; and has made more tasks scriptable, such as the importing of accounts from Windows NT 4.0 domains via the Active Directory Migration Tool.

WSH Scripting Improvements

Windows Script Host-based administration of Windows relies on two technologies: Windows Script Host (WSH) and Windows Management Instrumentation (WMI). WSH controls the execution of the scripting engines and enables scripts written in JScript or VBScript to access OS services and utilities and to access application programs through COM interfaces. The most important collection of those COM interfaces for administration is WMI, Microsoft’s implementation of the Web-Based Enterprise Management, a standard management framework defined by the Desktop Management Task Force. (For background on WMI, see the illustration "WMI Architecture".)

WMI allows administrators to monitor and configure file systems, printers, and network shares, as well as to retrieve performance data. It also provides a mechanism to monitor network services, such as the Domain Name Service (DNS) and Dynamic Host Configuration Protocol (DHCP), and monitor and respond to changes in the event log, file system, and Registry, as well as other real-time OS changes. WMI provides a way for administrators to manage computers without delving into the details of each individual resource’s APIs (for example, the Win32 API for Windows OS services), and it is the base infrastructure for a variety of management application agents, including Microsoft's own Systems Management Server (SMS) and Microsoft Operations Manager (MOM).

WMI Improvements

There are two key improvements to WMI in Windows XP and Windows Server 2003. First, more WMI providers in these OSs allow administrators to not only read the properties of a managed object, such as the disk quota for a user, but also to change or set the properties, such as setting a new disk quota. In Windows 2000, approximately 4,000 properties of managed resources were exposed to administrators by WMI, but only about 40 of these properties could be changed or set through WMI. Windows XP has more than 6,000 managed resource properties that can be monitored by WMI, and more than 140 can be configured using WMI.

Second, Microsoft has developed new providers, such as a provider for monitoring the health of AD replication and trust relationships, and a provider that allows administrators to manage Volume Shadow Copies. Additional providers are valuable to administrators as they open more resources for monitoring and configuration by WSH-based scripts and other management tools. (For a list of some existing and new WMI providers, see the chart "WMI Providers".)

Command-Line Improvements

Despite the power of WMI and WSH-based scripting, command lines and basic-batch scripting remain popular because they are easier to use and build for one-time or occasional tasks, and they do not require administrators to learn more complex scripting languages or COM interfaces. To make command-line and batch file administration more useful, Microsoft has extended some existing command-line tools, moved some tools from the separate resource kit into the base product, and added some new tools. (For a list of some existing and new command-line administration tools in Windows Server 2003, see the chart "Command-Line Tools".)

Extended tools. In Windows Server 2003, some existing command-line tools have been extended to provide more functionality. For example, netsh, a scriptable command-line tool for managing DHCP, DNS, and Routing and Remote Access Services (RRAS), can now manage the IPSec security protocol and incorporates functions of the netdiag command (which no longer exists as a separate command). In addition, some existing tools, such as the Active Directory Migration Tool, have been extended to facilitate their use in a script or batch file.

Moved tools. In the past, many command-line tools shipped separately from Windows products, typically as part of an edition-specific resource kit. Although these tools were useful, Microsoft offers no support for tools delivered as part of a resource kit. In Windows Server 2003, many tools that made creating batch file scripts easier are included with the server and fully supported. For example, choice, which presents a "Yes/No" option to control branching during batch file execution, is now delivered with the server.

New tools. Windows Server 2003 includes new command-line tools, such as GPResults, which allows administrators to determine which Group Policy-managed policies have been applied on a computer, and the Windows Management Command Line (WMIC), which allows administrators to access WMI from a command-line interface.

WMIC (which is also available in Windows XP) is a tool for day-to-day administration and enables administrators to use the command line or a batch file to do tasks that previously would have required a more complex WSH-based script. It uses aliases—friendly command-line names for WMI classes—to hide some of the complexity of WMI and provide access to the underlying management information. For example, instead of having to use the exact WMI class name of "WIN32_LOGICALDISK" to access disk drive information, an administrator can use the friendlier "Logicaldisk" with WMIC. WMIC can easily format the output of any WMIC command as plain text, HTML, XML, MOF (a WMI-managed object format), and CSV format (comma-separated values suitable for import into applications such as Excel). (For an example of a WMIC interactive session, see the illustration "A Typical WMIC Session".)

Although administrators can extend WMIC by defining new aliases or adding new output formats, WMIC’s ease of use comes with some limitations. Only a subset of WMI functionality is available, and administrators cannot automatically send or pipe the output of one WMIC session to the input of another.

Better Tools and Training Still Needed

Microsoft has made substantial improvements to the management facilities in Windows XP and Windows .NET Server, but administrators could still use better tools for editing and debugging scripts, and they may require training in the new scripting languages.

Today, most administrators use a text editor, such as Notepad, to create and maintain administrative scripts. To debug the script, they include output statements that display which function the script is executing or the value of a variable at a given point in time. Microsoft currently does not provide a lightweight script-editing tool and debugger to facilitate the development and maintenance of scripts by non-developer administrators. Microsoft's Visual Studio .NET Integrated Development Environment (IDE) allows a developer to write C# or VB.NET programs that use WMI information, but it is expensive and complex for use as a scripting tool.

Although Microsoft has made a large number of sample scripts and tutorials on scripting available, administrators who are familiar with writing command lines or batch scripts, but not with object-oriented scripting languages like VBScript, may need some training to understand how to write WSH scripts and work with other programs and services, such as WMI, via their COM interfaces.

Resources

For more information on WMI, see msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/about_wmi.asp.

For tools for exploring WMI, see www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6430F853-1120-48DB-8CC5-F2ABDC3ED314.

For information on WMIC, see www.microsoft.com/technet/prodtechnol/windowsserver2003/proddocs/server/WMI.asp.

For information about command-line tools, see "Command-Line Reference A-Z" in the Windows XP or Windows Server 2003 Help and Support Center accessible via support.microsoft.com/.

For information on Managing Windows XP and Windows 2000 Professional, see the Apr. 2003 Research Report "Improving PC Management with Windows Server 2003."

For information on Group Policy, the Group Policy Management Console (GPMC), and GPResults, see "Windows .NET Server Reduces Fear of Group Policy" on page 3 of the Jan. 2003 Update.

For sample scripts, see www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp.