ADSI Scripting for Pros
System administrators can save time and effort with scripting. Here's the guide to show you how.
by Hinne Hettema
5/15/2001 --
|
|
|
Title |
|
|
|
Windows NT / 2000 ADSI Scripting for System Administration |
|
Authors |
|
|
|
Thomas Eck |
|
Publisher |
|
|
|
New Riders |
|
Publication Date |
|
|
|
March 2000 |
|
ISBN |
|
|
|
1-57870-219-4 |
|
Price |
|
|
|
$45 (U.S.) |
|
Pros |
|
|
|
Very detailed and comprehensive. |
|
Cons |
|
|
|
Based on VB rather than VBScript 11. |
|
Verdict |
|
|
|
Get this book -- it's a superb tool for system administrators. |
|
|
|
|
|
|
|
|
|
|
|
|
|
The first, somewhat cheeky title I had in mind for this review was "Windows with the power of Linux," but I decided that would not look so good in large print. It's true, however, that the ability to fully script installation and system administration has been missing from the Windows operating system for a relatively long time. The release of the Windows Scripting Host and Active Directory Services Interface a few years ago has really changed that. As a result, there is a growing interest in scripting from NT and 2000 administrators. Those administrators would do well to get a copy of this book. It contains every scripting trick I was aware of, and then some.
If you're unsure of what scripting is all about, here's a one paragraph introduction (O.K., a long paragraph). Consider this scenario: Every day you, the system administrator, have around 20 users calling, asking you to reset their passwords. You decide to use a simple password for this task, such as "pwddmm," where "dd" and "mm" stand for the day of the month and the month, respectively. You also tick the "User must reset password at next logon" box at each reset to force the user to change their password upon the next logon. Doing this with the GUI for 20 users a day can become boring and time consuming. Wouldn't it be great if you had a utility to do this automatically? You could then type something like "user_reset username" and the utility would handle the rest. "User_reset" would then normally refer to a script: a set of commands written in a scripting language. This simplifies the task, takes care of things you might otherwise forget and implements all standards as you want them.
From this example, it's easy to see the power of scripting. A script will allow you to implement a workflow (always tick the "reset" box after resetting a password), adhere to corporate standards (such as pwddmm for password resets), and save time and effort on administration.
Thomas Eck's "Windows NT/2000 ADSI Scripting for System Administration" shows you how to do most of this and more. The book contains a large number of code samples for almost every administration task imaginable. This includes normal user and account management, computer management (especially services and print queues), management of IIS and, of course, Active Directory.
This volume shows you, in detail, how to use the WinNT://, IIS:// and LDAP:// ADSI service providers, invoke their methods and get useful results back. The book steps beyond mere scripting in that it primarily shows you how to develop COM objects that you could access from ASP, for instance, to build your own system administration console. Using the code samples in this book, you'll be able to manage users, groups, services, print queues, the IIS Web server and Active Directory.
All the examples in the book are written in "pure" VB rather than the easier-to-use VBScript. Maybe not your preference, but the advantage of this is that VB is strongly typed, and thus exposes the datatypes of ADSI. VBScript uses the variant data type as a default, which, as Thomas Eck remarks, "robs you of a solid understanding of the datatypes used with ADSI."
On the back cover states that this text is suitable for the advanced user. Unlike some other books that make this claim, this book means it. I would heed that remark -- this book is definitely not for the beginner. Fortunately, it includes a large list of further resources in one of its appendices where you can find further material to help you.
You can download the code samples of the book at http://www.newriders.com/adsi. This site is worth a look anyway, even if only to determine for yourself whether you'll be able to benefit from this book right now, or should start at the intermediate rather than advanced level of this topic. Once you have worked through that intermediate level, though, I'd recommend you get this one to take you that step further.
Have you read this book? Let us know what you think! Rate it below or enter our Forums.
Hinne Hettema works for a large computing outsourcing firm in Auckland, New Zealand, specialising in the area of Application Service Providers. He is Microsoft (MCSE NT4 and W2K), Citrix (CCA) and Cisco (CCNP) certified and has a PhD in computational chemistry and an MA in philosophy. He lives in a 1930s villa on the edge of the Manukau harbour with his wife, daughter and three cats, as well as numerous computers. He is also the editor of 'Quantum Chemistry: Classic Scientific Papers' (World Scientific, Singapore 2000). He can be reached at and likes to receive email.
More articles by Hinne Hettema:
|