Chapter 1. Introduction

The Windows Server operating system (OS) has come a long way in the past ten years. In the early days of Windows NT, system crashes were common annoyances that administrators had to learn to deal with. There were few tools to manage the OS, and the ones that were available, which mainly consisted of the graphical variety, were limited in functionality and didn't scale well. Also at that time, Microsoft was not yet serious about providing intuitive scripting interfaces, which would enable administrators to automate repetitive tasks. The result was that administrators were forced to do a lot with a little.

The tides changed dramatically with the release of Windows 2000, which turned out to be much more scalable and manageable. Microsoft began to improve in the management areas it had previously lacked by adding more tools and introducing several new scripting interfaces that were robust and easy to use.

But in many ways, Windows 2000 felt like a first version release of a major piece of software, which it was. Windows 2000 did a lot of things right, but there were still major gaps in terms of manageability. Windows Server 2003, Microsoft's latest server OS, is a much more mature platform. It isn't as big of an upgrade as Windows NT to Windows 2000, but Microsoft smoothed out a lot of the rough edges that were present in Windows 2000.

So what are we left with? If I had to sum it up into a single sentence: Windows Server 2003, and Windows 2000 to a lesser degree, is a sophisticated OS that has been built from the ground up to be both scalable and manageable, and supports all of the major information technology services you need to run a business or organization. The result is that administrators now have to do a lot with a lot.

You can't get all of this capability wrapped up into a single OS without some trade-offs. To be able to take full advantage of Windows 2000 Server or Windows Server 2003, you have to know lots of gory technical details. You have to know how to navigate through the hundreds of dialogs and menus. You have to know which command-line utilities are available to accomplish various specific tasks, where to find them, and which options you should use for each utility. You have to know what scripting interfaces are available to automate tasks so you can keep your support costs low. We take it for granted, but that is a lot for any one person to know. I've been doing Windows system administration for eight years and I still have a difficult time recalling the correct tool or command or scripting interface for certain tasks.

And that is the purpose of this book: to be a comprehensive reference so I don't have to waste time (and brain cells) trying to remember that Windows Management Instrumentation (WMI) doesn't have any scripting interfaces for creating or modifying page files; or how to use Group Policy to run a task on a group of workstations; or how to find all of the files that are currently open on a system. This book covers general system administration duties, but it also covers a great deal more. There are dedicated chapters on many of the major services you'll end up running at one point including IIS, DNS, DHCP, Active Directory, and Exchange.

Approach to the Book

If you are familiar with the O'Reilly Cookbook format that you can find in other popular books such as Active Directory Cookbook, Perl Cookbook, or DNS and BIND Cookbook, then the layout of this book will not be new to you. It is composed of 17 chapters, each containing 10-30 recipes that describe how to perform a particular task. Most recipes contain four sections: Problem, Solution, Discussion, and See Also. The Problem section briefly describes the task the recipe addresses and when you might need to use it. The Solution section contains step-by-step instructions on how to accomplish the task. Depending on the task, there could be up to three different sets of solutions covered. The Discussion section goes into detail about the solution(s). The See Also section contains references to additional sources of information that can be useful if you still need more information after reading the discussion. The See Also section may reference other recipes, Microsoft Knowledge Base (MS KB) ( articles, or documentation from the Microsoft Developers Network (MSDN) (

At Least Three Ways to Do It

People like to work in different ways. Some prefer graphical interfaces (GUIs) while others like to work from the command-line interface (CLI). And experienced system administrators like to automate tasks using scripts. Since people prefer different methods, and no one method is necessarily better than another, I decided to write solutions to recipes using one of each. That means instead of a single solution per recipe, I include up to three solutions using GUI, CLI, and scripting examples. That said, some recipes cannot be accomplished with one of the three methods or it may be very difficult to do with a particular method. In that case, I cover only the applicable methods.

In the GUI and CLI solutions, I use standard tools that are readily accessible. There are other freeware, shareware, or commercial tools that I could have used that would have made some of the tasks easier to accomplish, but I wanted to make this book as useful as possible without requiring you to hunt down the tools or purchase an expensive software package.

I took a similar approach with the scripting solutions. While I prefer Perl, I use VBScript due to its widespread use among Windows administrators. It is also the most straightforward from a coding perspective when using WMI and Windows Script Host (WSH). For those familiar with other languages, such as Visual Basic, Perl, and JScript, it is very easy to convert code from VBScript. See the sidebar "Differences Between VBScript and Perl" for more information on how to convert between those two languages.

For those of you who wish that all of the solutions were written with Perl instead of VBScript, you are in luck. I've posted companion Perl scripts for each VBScript example on the book's web site. Go to to download the code.

Windows 2000 Versus Windows Server 2003

Another challenge with writing this book was determining which operating system version to cover. Many organizations still run Windows 2000, but Windows Server 2003 has been a big seller (at least according to Microsoft). Since Windows Server 2003 is the latest and greatest version and includes a lot of new tools that aren't present in Windows 2000, my approach is to make everything work under Windows Server 2003 first, and Windows 2000 second. In fact, the majority of the solutions will work unchanged with Windows 2000. For the recipes or solutions that are specific to a particular version, I include a note mentioning the version it targets. Most GUI and scripting solutions work unchanged with either version, but Microsoft introduced several new command-line tools with Windows Server 2003, many of which cannot be run on Windows 2000 as certain system application programming interfaces (APIs) have changed from Windows 2000 to Windows Server 2003. Typically, you can still use these newer tools on a Windows XP or Windows Server 2003 computer to manage Windows 2000.

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.