Section 1.1. Approach to the Book


1.1. 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) (http://support.microsoft.com/) articles, or documentation from the Microsoft Developers Network (MSDN) (http://msdn.microsoft.com).

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 http://www.rallenhome.com/books/ to download the code.

Differences Between VBScript and Perl

Here are some of the main differences between VBScript and Perl:

  • With Perl, you have to use the Win32::OLE module and Win32::OLE->GetObject method to access the WMI, WSH, or ADSI scripting interface. With VBScript, you simply need to call the built-in GetObject function.

  • Perl uses the arrow operator (->) to invoke a method on an object, whereas VBScript uses a dot (.).

  • In Perl, the backslash (\) character is the escape character, so you need to use two backslashes when using it within double quotes.

  • Perl uses special characters to distinguish variables, whereas VBScript doesn't use a character. With Perl, the basic convention is the dollar sign for scalar variables (e.g., $string), the at sign for arrays (e.g., @elements), and the percent sign for hashes (e.g., %dictionary).

  • Perl is generally case sensitive, whereas VBScript is not.

  • VBScript requires an underscore to continue a statement to the next line, whereas Perl does not.

  • Perl uses the dot (.) for string concatenation, whereas VBScript uses the ampersand (&).

  • Perl requires that each statement end with a semicolon (;), whereas VBScript assumes the end of the line is the end of the statement (unless the underscore continuation character is used).

  • Perl uses the my keyword to predefine variables, whereas VBScript uses the Dim keyword.

  • Perl uses pound (#) for comments, whereas VBScript uses a single quote (').

If you can keep these differences in mind, along with being able to convert basic language constructs (for loops, if then else conditionals, etc.), you should have no problems converting VBScript to Perl.


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.



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net