SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Powershell for DBAs

By Steve Jones,

A few weeks ago I attended SQL Bits and noticed there were a number of people talking about using Powershell (PoSH) with SQL Server. Laerte Junior have a troubleshooting talk and Allen White talked about maintaining performance. I've started to notice more and more people are showing Powershell as a tool to accomplish repeatable tasks, run across multiple servers.

I've struggled to use Powershell much in my work, but I don't have a lot of repeatable tasks in SQL Server. I tend to be more like a consultant, with a lot of ad hoc work that varies across different instances. However I do have scripts I run regularly, like the sp_Blitz script, and these are exactly the type of tasks that work great in Powershell. As I start to work in Azure, scripting is important and I can see the value in using something like PoSH that is easily dropped onto a new machine to perform a variety of tasks, like configuring SQL Server.

This week I saw a post on getting started in Powershell and it reminded me that I should be improving my skills. I might not use them often, but more and more content, and automation examples use Powershell and being able to read and understand it will become more important. That might especially be true if you find storage or system administrators wanting to run PoSH on your database servers. I'd hope you would understand what they planned to do before they do it. Or you can backtrack and understand what they changed with their script, which might not be what they tell you they changed.

I don't know that Powershell will be required at most, or even many, companies. However I do know that Microsoft is pushing it, it's not hard to learn, and it's handy. If I were back in a situation where I was managing 10, 20, or more instances, I'd want Powershell to help me handle the basic, tedious tasks. At some point those easily automated tasks won't be worth paying someone to do. If you can't add value in other ways, you might find yourself struggling to maintain employment.

Total article views: 488 | Views in the last 30 days: 1
Related Articles

Execute SQL Script against Multiple Servers by PowerShell

Execute SQL Script against Multiple Servers by PowerShell


Stairway to SQL PowerShell Level 1: SQL PowerShell Basics

What are PowerShell and SQL PowerShell and how do you use them? Level 1 of this Stairway will help ...


Running Powershell scripts remotely.

I’ve only recently started to play with Powershell (PoSH) but even I’ve begun to discover what a hug...


Paging Doctor Powershell

Use Powershell to create a single script that checks over your server and every SQL instance on it t...


Where Do I Start with PowerShell?

Introduction This morning I set out to get some information about getting started in PowerShell f...

database weekly