Sunday, March 4, 2012

Why Script It?

Before we get into the nuts-and-bolts of making scripts to make you more productive, I want to take a minute to consider why you would or not build a scripted solution.  I run into many IT professionals who have great technical knowledge but never develop skills at automating their tasks.  They get the job done, but not always efficiently.

There are valid reasons for not scripting your solutions.  Maybe it really is a task you will do once.  Or something you do so infrequently that there is little value to spending the time to create, test, and debug your script.  Or maybe it is a task for which there are no facilities that allow scripting such as a GUI only interface.

But more often than not you can build an automated solution.  And the more you build scripts the more adept you become at doing it, which makes you more productive, which means you (hopefully) make more money.

Repeatability
In IT if you have to do something once you usually have to do it dozens or hundreds or thousands of times over the course of a contract or project or career.  By scripting your solution you ultimately save time. 

Say a task takes a minute to do manually.  And assume it takes you an hour to create, test, and debug a script that does the same task in a second.  If you have to do that task once a week you get your time back in a year and by the second year you've earned yourself an extra lunch hour.

Consistency
Sometimes consistency is just a stylistic issue such as ensuring consistent capitalization or naming conventions.  But it can be critical in situations where case sensitivity is important, objects need to be in specific locations, or other systems require reliable output from your process.

Delegation
If you need to pass tasks on to others it is to your advantage to make those tasks as simple and bulletproof as possible.  Sometimes the people performing the tasks will not have the best technical skills, sometimes they won't have the extra time, and sometimes they just won't care.  If you can give your delegate the ability to push a few buttons you have a better chance for success than asking them to follow a detailed list of manual tasks.

Reliability
By creating scripts in a test environment you can make sure everything works as expected before you run the tasks against production systems and live data.  By working out issues beforehand you can reduce (and hopefully eliminate) negative impact to end users and reliance on backups.

Change Management
By showing the steps you will take before you take them, and showing confirmation that the steps produce the desired results in your test environment, you generate a clear procedure that can be reliably approved by internal change management facilities.

Audit ability
I always make sure my scripts produce output showing the progress and results of the scripts.  I then save the logs with the project or change management records.  Two years from now when I get blamed for questioned about something my scripts did I can show a clear audit trail to refute the allegations.  And if it is my fault I have the script and output to provide the required details to make corrections.

Commenters: What other reasons do you have for creating scripted solutions for you administrative tasks?

No comments:

Post a Comment