O'Reilly Network    
 Published on O'Reilly Network (http://www.oreillynet.com/)
 See this if you're having trouble printing code examples


Active Directory Cookbook

VBScript or Perl?

The Windows Sys Admin's Scripting Dilemma

by Robbie Allen, coauthor of Active Directory, 2nd Edition, and author of the recently released Active Directory Cookbook
11/18/2003

As I was working on Active Directory Cookbook, I had to make a decision that many Windows system administrators face at one point or another: whether to use VBScript or Perl? I'm a long-time Perl guy, but unfortunately, no matter how much I preach the benefits of Perl, the Windows sysadmin community hasn't embraced Perl the way it has been embraced on the Unix side. Ultimately I decided to use VBScript because it is the least common denominator as far as scripting languages go on the Windows platform (besides batch files, of course). I did, however, include Perl examples on my web site so as not to leave out the Perl coders.

I was able to take the easy way out by using both in this case, but most system admins only need one, but which one? I've already stated my preference towards Perl, but I want to outline the pros and cons of each because both languages have their place. You can accomplish most of the basic system admin tasks with either language. For this reason you'll need to look at the other advantages and disadvantages of each language to determine which works best for you.

Overview of VBScript

VBScript is a subset of the Visual Basic programming language. You can run VBScript code using a Windows Scripting Host interpreter (wscript.exe or cscript.exe) or from within Active Server Pages (ASP).

Advantages of VBScript

Disadvantages of VBScript

Related Reading

VBScript in a Nutshell
By Paul Lomax, Matt Childs, Ron Petrusha

Overview of Perl on Windows

Perl has a long history dating back to 1987 when Larry Wall released the first version. Now, an army of dedicated Perl hackers actively maintain Perl, and ports exist for virtually every modern operating system.

Advantages of Perl

Disadvantages of Perl

Summary

If you want to get serious about automation in the Windows environment, I recommend using Perl because of its extensive module support and the overall robustness of the language. If you only want to do something quick and dirty or you don't have any programming experience, VBScript is probably your better bet.

As far as other scripting languages go, a case could be made for using JScript because of its integration with the .NET Framework, but I don't find many people using JScript for system admin tasks. I'll leave that for someone else to argue.


O'Reilly & Associates recently released (September 2003) Active Directory Cookbook for Windows Server 2003 & Windows 2000.

Robbie Allen is the coauthor of Active Directory, 2nd Edition and the author of the Active Directory Cookbook.


Return to the O'Reilly Network.

Copyright © 2009 O'Reilly Media, Inc.