Automation is the key to implementing scalable and secure IT services while keeping support costs low. I believe all good system administrators should be able to do at least basic scripting. Here are links to the scripts contained in my books:
Browse source code for Windows Server 2003 Networking Recipes
113 scripts written in VBScript, Perl, and Registry File format
Browse source code for Active Directory Cookbook, Second Edition
519 scripts written in VBScript, Perl, and LDIF
Browse source code for Active Directory, Third Edition
215 scripts written in VBScript, Perl, ASP, and Visual Basic
Browse source code for Windows Server 2003 Security Cookbook
82 scripts written in VBScript, Perl, and Registry File format
Browse source code for Windows Server Cookbook
524 scripts written in VBScript and Perl
Browse source code for DNS on Windows Server 2003
27 scripts written primarily in VBScript and Perl
Browse source code for Managing Enterprise Active Directory Services
139 scripts written in Perl, VBScript, and Visual Basic
I’ve also written some miscellaneous scripts to solve particular problems:
Extending the desktop (via a script)
Outlook Scripts
I have a love/hate relationship with Microsoft Outlook. It is the most robust graphical email client I’ve ever used, but it is not without limitations. In fact, I’ve felt the equivalent of road rage, except for my email client, on more than one occasion (especially when Rules are involved). Anyway, in order to overcome some of Outlook’s inflexibility, I’ve done some dabbling with CDO and MAPI
programming, which are Microsoft’s programmatic interfaces to Outlook and Exchange. Here are a couple of scripts I’ve written:
- Set View for all Folders
I really like Outlook 2003, but I couldn’t find a way to force all folders to use a particular view, so I wrote a script to do it. If you use Outlook 2003, I’m sure you know about this rather annoying issue. You can change the “Messages” view but there is no way to force all folders to use the settings in the view you modified. All that is really needed is a feature like in Windows Explorer where you can set a default display for all folders. Anyway, this script does the trick. The only thing you have to be cautious of is getting the XML for the view settings right. If you mess it up, it could cause your folders to not display anything! I had that happen to me while testing this script. It is not a huge deal because you can go back in and tweak the script or modify the view via the GUI.
- Inbox watcher
Before I started to use Outlook 2003, I wanted a way that I could keep an eye on the number of messages in my inbox without actually looking at Outlook. I find myself checking Outlook a lot just to see if there are any new messages. Well with this script, I use the Win32::GUI module to display a small dialog box on the desktop that shows all the UNREAD messages in my inbox. I had to use Outlook Redemption to work around the Outlook behavior of restricting external programs from access messages.
Amazon Scripts
I’m a big fan of Amazon. I go there to buy books and see the status of my own books and check out new reviews of them. It turns out that the Amazon Sales Rank is a pretty good relative measure of the success of a book. I grew tired of visiting the Amazon site to see this stuff so I decided to write some code to automate the process! The Amazon Web Services API provides all the information I need and the Perl Net::Amazon module provides the interface.
Since I wrote this script I’ve found out about JungleScan, which does a similar thing, but it actually keeps a history of sales rankings. The graphs it generates are not that great. One of these days I’ll add that capability to my little script.
