PowerShell for DBAs – why I changed my mind.

Quick post today…

I have been saying for several years that I don’t really need PowerShell to be an effective DBA.  In most places that is true, but becoming less so.

I’ve resisted writing complex PS scripts for administration, as most Junior and Mid-level DBAs don’t know it, so I don’t want to leave a client in the lurch with code their staff cannot understand.

I’ve only once in an interview been asked if I know PS.  “No” was a perfectly acceptable answer.

Things change.

2 very solid reasons (there are others) that every DBA should be learning and using PowerShell:

1 – Its very useful for admin at the O/S level.

At my current client I am team lead of System and SQL Admins, along with doing any of the work that comes our way.  This means we need to be able to manage the modest server farm we have.  Its big enough that we can’t log onto every server every day, but small enough nobody wants to buy a proper monitoring toolset.  So…PS to the rescue!

One of our tasks is to manage the Event Logs and deal with Warnings and Errors that come up.  I wrote this script to dump the last 7 days to a file we can work with.  This has since been updated many times, and now uses a different CmdLet.   One of my DBAs wrote a script that checks drive space on all servers and sends a color-coded email daily.   Much of this came from Googling, which is perfectly fine.

2 – Its on the 2016 certification exam now (probably).

Course 20764B: Administering a SQL Database Infrastructure has Powershell as an objective:

  • Managing SQL Server using PowerShell

While the Exam 764 “Skills Measured” section doesn’t specifically call PS out, its very likely to be there.

For those new to SQL or getting certified to help your career grow, just go ahead and add PS to your toolkit.  You are going to need to at least be able to read a script, and will probably be expected to know the SQL Server Module’s CmdLets, if not more.   Just do it.



Leave a Comment

Sign up for our Newsletter

%d bloggers like this: