Self paced bad practices
I got this as a freebie ebook when I bought the WMI scripting book.
What a total waste. I am new to Widows scripting but an old hack at *Nix shell scripting and perl. I needed to do some scripting for a client that doesn't have perl installed universally, but wants scripts to run universally on their windows servers.
I wasted a couple of days beating my head against the wall because I used this book. I finally bought "Windows 2000 Scripting Guide" and got my scripts working.
In addition to the complaints others have left indicating the the author does not explain the programming model, I found myself with a large hole in my foot because this author directed me to point a gun at my boot before pulling the trigger.
I used the sample scripts in the book as a starting point in my scripts, but unwittingly injected really bad practices into my programs.
The author states in Chapter 1:
"So 'On Error Resume Next' tells the computer that when something is messed up (causing an error), you want the computer to just skip that line and try the next line in the script. This process is called error handling,"
Actually, this is called ERROR HIDING (not handling) and it causes things that are messed up (causing an error) to be hidden from your view so you CAN'T find or fix them.
This is the worst bad practice that can be taught
Here is an example of how bad it is:
while using this directive your code that looks like:
IF condition THEN
positive_action
ELSE
negative_action
END IF
will, when an error is encountered in evaluating the condition, get transmogrified into simply:
positive_action
The "condition" that includes an error ALWAYS evaluates to true.
I can't think of a worse logic bomb to inject into your code or a better reason to skip this book.
Not a bad little intro
I admit I avoided purchasing this book as I felt I was beyond it since I know Perl. I ran into it again when I purchased Microsoft Windows Administrator's Automation Toolkit (Pro-One-Offs). On the CD there is a e-book form of the book.
I figured why not read it? One possible drawback exists if you pick up the automation toolkit book. You will not get a copy of the scripts. It's not an issue if you don't mind typing. Which for me is better as making mistakes and debugging helped me more then simply watching a script run.
I noticed that the e-book might be an earlier version of the printed book as the scripting style changes for a copy of the scripts.
As to the claims of the scripts not working; I ran into that as well but they are easy to solve. Well except one. You look for computers in AD, the scripting didn't know how to handle a Linux Samba entry.
Overall the book is decent. I was looking for something to give me an introduction to vbscript. Something more then a beginning "howto" script book.
There is not much discussion about the WSH engine. However, for me that was not an issue as I am still in the beginning stages of vbscript. This might be more of an issue as I get more advanced. But, this will probably get solved by an advanced book or looking on the Net.
The book does some basic stuff in the beginning. Loops, if/then, Arrays. Part 2 of the book introduces basic administration. There you will be introduced to file system objects, WMI, and WMI queries. Part 3, takes more advanced administration issues with and introduction to LDAP, ADSI, Searching AD, Configuring Network components, logon scripts, working with registry, and working with printers. Part 4, deals with other apps such as IIS6 and exchange 2003.
The appendix has some info on ADSI, and WMI. It's ok if you are starting out but I think it will grow past it's usefulness.
The scripts in book are simple and straightforward. They don't have a great deal of intelligence built in to deal with unknowns. Probably, not needed as this is an introduction book.
Overall I am happy with the book. It gave me an idea as to some possibilities and it helped me understand better on where to look for stuff.
Fast Paced Learning Tool
I use the book all the time to help groups of customers learn scripting. It jumps into useful examples early in the book. You build on those examples until you get to the point where you are combining the technologies to build useful scripts, like using Active Directory to create a list of computers which you then analyze and configure using Windows Management Instrumentation ( set of extensions to the Windows Driver Model that provides an operating system interface through which instrumented components can provide information and notification ). If you read only to chapter 15 you get a solid background of how WMI exposes a collection of COM scriptable objects that allow various applications to take advantage of the management information, including information about how Active Directory can be manipulated with VB Script.
Excellent Book
I've found this book with excellent content and very helpful for my clients ( I Work in a Technical Support Group for VIP Customers). The author drives you through with very clear language and at the same time funny and keeps you hooked to it.
Highly Recommended! Specially for those deep into Thechnical stuff.
Good information
This book had everything I was looking for and is a good source of information.