Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 2006

Meet Scripting's Everyman

IT veteran Tory Skyers explains his "get-it-done" approach to Windows scripting
RSS
Subscribe to Windows IT Pro | See More Task Automation Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Introducing Windows PowerShell

Download the Code Here

While Microsoft points toward Windows PowerShell as the next generation of Windows scripting, most systems and network administrators and IT managers are more concerned with getting today's tasks done by using the tools at hand--writing scripts by using Windows batch files or VBScript. IT pro Tory Skyers, a network administrator for Prudential Fox & Roach, Realtors (an independently owned and operated member of The Prudential Real Estate, Affiliates, Inc.) is a longtime scripter who's written dozens of scripts to automate many aspects of Windows administration, such as deployments and end-user PC backup and restore. Although Tory calls his scripts "hamfisted," inelegant or not, they've done a lot of useful work and made his job easier. In a recent conversation with Senior Editor Anne Grubb, Tory talked about his passion for scripting and some of the scripts he's written to help manage the 1500-plus-machine IT environment he oversees.

You're basically an all-around IT person. What sparked your interest in scripting?

I started scripting on a Commodore 64 when I was about 10 years old, although I didn't know then that it was scripting. Later I got into OS/2 and REXX, and now I write primarily VBScript and also some bash shell [Linux] scripts. But what really got me going was Windows IT Pro 's scripting CD. We have something from your publications, or from someone who contributed to the magazine, in just about every one of our scripts. Most of what I write is straight-up, play-with-it-'til-it-works scripting. A lot of it comes from the community-- Windows IT Pro, resources I find on Google--which I customize to fit the task.

Talk about some of the scripts you've written to automate IT tasks.

Well, the one I'm most proud of--because it took forever to write--is what I call a computer-finishing script. We don't use Microsoft infrastructure to deploy images, so I built a script that imports registry entries to change particular aspects of applications, install applications, and put shortcuts on the desktop, then launches our antivirus installation and inventory applications and joins the machine to a domain, all before the machine gets deployed. We used this script for about a year until we started using another imaging system.

Another script that I use a lot is my "are you alive" script. I manually use CSVDE to export a CSV file containing the names of computers in the domain from Active Directory (AD) and copy it into a text file. (I'd like to use DSFind or joeware.net's AdFind to export from AD, but I haven't gotten around to that yet.) Then the script pings every computer that's in the CSV file and writes the output to either an "alive" or a "dead" file. It tells me whether or not a machine is active, so I can query users who own inactive machines.

I've also written some backup scripts. The most interesting one uses PKZIP to back up the My Documents folder, email, and a few other things to a .zip file on a local system, then copies the .zip file to a network share, using the time and date of whenever you last ran the script as the [backup] filename. The user can either run the script manually or as a scheduled task. The restore script looks for the filenames, asks you which do you want to restore, and copies it either to the original destination or another destination that the user chooses. The really useful thing about this method is that the backup files are browsable--they're not in a proprietary format, as are other local backup solutions I've seen. You can just browse through the .zip file, double-click the document you want, and restore it.

Are there some tasks you've found too complicated to script?

Enforcing policies and permissions. Windows environments typically grow organically; they're not really planned. You know, we need a domain... well, let's add a domain. When that happens, it gets harder for IT to enforce policies and manage Group Policy. To enforce policies, we use ScriptLogic's Active Administrator, which lets me apply permissions by using a template. I can create a template of a permission for a particular user, then apply individual templates to a group, and add users to the group. Removing the permission is as easy as turning off the template. The product also provides reports, so we can keep track of what permissions were set, and creates change logs that let you see every change you've made to an AD object.

What do you think of Windows PowerShell?

I downloaded it and took a look but haven't played with it enough. It's definitely a culture shock coming from Windows Script Host (WSH) and going to PowerShell, only because PowerShell does so much. With WSH, you had to find kludgy workarounds; it just lent itself to simplicity. With PowerShell, as a WSH scripter, I'm looking at it and wondering, where do I start? What's an object? What I'd like to see in Longhorn is something similar to the "script this" feature in SQL Server 2005 Management Studio's Generate SQL Server Scripts Wizard. It automatically creates a script of everything you've done via the Microsoft Management Console, and lets you go in and tweak the scripts to do what you need.

You seem to be the quintessential Windows scripter: You're resourceful about finding code to help you script a particular admin task, and you tweak those scripts and add your own code to fit your needs.

I don't know about "quintessential," but the rest fits me! I often wish, though, that I had time to go back and stick more features into the scripts I've written. But the fact is that once I've saved myself that initial block of time, I'm on to the next project that I've freed up time to do as a result of the script I just wrote!

End of Article



Reader Comments
Haven't read it yet

prolific0ne December 19, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
10 Reasons to Deploy Windows Vista

The decision to upgrade your XP systems to Vista is simple when you consider features such as easier backup, a great desktop search, and vastly improved security options. ...

10 Reasons Not to Deploy Windows Vista

The decision to upgrade to Vista has to make business sense, but many companies find the costs in training and application compatibility problems outweigh any benefits Vista brings. ...

WinInfo Short Takes: CES 2009 Special Edition

An often irreverent look at some of the week's other CES 2009 news, including covering the Vegas spectacle from the comfort of my own home, Windows 7 public beta, a weird Microsoft song application, Palm Pre, pending Microsoft mobile moves, and much more ...


Task Automation Whitepapers Essential Guide to E-discovery and Recovery for Microsoft Exchange

Continuous Data Protection and Recovery for Microsoft Exchange

Protecting (You and) Your Data with Exchange Server 2007

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

PowerShell 201 - eLearning Series with Paul Robichaux

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Patch Management

Related Task Automation Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing