Are you using Powershell to its fullest?

Powershell is a fabulous tool, but are you letting it save you time, or are you just playing around?

I'm the lead DBA in a large IT shop and I manage hundreds of servers every day.  And one of the main tenets I've propagated throughout my group is that we should be using powershell for as much as possible.  There's just so much that can be done with it and so much time and effort it can save you it's ridiculous to not use it to its fullest.  And when I teach powershell sessions at conferences I always ask how people are using it and they're almost always using it for a very small subset of things they could be.  They use it to mostly do simple things on individual servers, and while I'm glad they're at least using it, it's just not enough. 

What I want is to see is DBAs treating their shops like one big environment instead of 500 separate servers that need to be managed.  Manage all of your servers as close to the same way as you can.  There will always be some exceptions, but they should always be very few.  You should always try your best to standardize on your file growth rates, and your backup schedules and methods, and your log retention, etc.  For instance, if I have one box that needs log backups every hour and another that needs them every 15 minutes, why not back them both up every 15 minutes?  You're not going to really take up any more space by backing up more frequently, so why not standardize?  This kind of standardization really helps because when users ask you questions about how things are set up you don't have to guess or go look it up.  You know in your environment that log backups are taken every 15 minutes and you can answer the question with a large degree of certainty even if there are a couple exceptions. 

And this is where powershell can really come in handy.  With powershell you can run scripts against all of your servers at once and you can make sweeping changes with very little effort to you.  This is becoming such a pervasive method with me that I don't allow my DBAs to do stuff like that outside of powershell because it just wastes the company's time.  I don't want any of my guys sitting there clicking through screens or cycling through servers for 2hrs when they could write a powershell script and be done in 10 minutes.  Sure, different DBAs work in different ways, and I try to embrace that where I can, but some methods are actually better than other methods and someone needs to guide those efforts. 

I've even started working with the Windows team to get them using powershell for their installs.  They've got tons of settings, user accounts, etc to setup every time they install Windows on a new box and scripting that stuff is the best way to make sure it not only gets done right, but quickly too.

I've had many customers call me amazed that I was able to fulfill a relatively involved request in just a few minutes.  So if you're not using powershell as your main method of server admin, and more important multi-server admin, then you're doing yourself and your company a huge disservice because you're just wasting time.  You can get so much more done by managing all of your servers as a single server with powershell. 

Now, if you want to learn powershell there are plenty of places to go.  For starters however, I'm going to point you to my free website where I've got a ton of powershell videos and some even start from the ground up.  You can see them here:  http://midnightdba.itbookworm.com/Admin.aspx.

Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.

Copyright © 2011 IDG Communications, Inc.