Last week I presented at my user-group about PowerShell and why every DBA should know this. The talk went for just over an hour, and as most of the audience hadn’t used PowerShell at all, I started from the top and really pushed concepts like “You pipe objects not text”. The script can be downloaded from here.
So then by the time I got around to talking about the fact that you can really easily hook into ADO and SMO, I think the audience were already caught on the idea that PowerShell really is very powerful and that anything you can do with SMO can be done really easily with PowerShell too. Most DBAs write scripts that use SMO to manage their SQL boxes. In the past they’ve used VBScript, but I think they should use PowerShell – it’s got so much more going for it, and because it can replace cmd, there’s almost no reason not to use it.
The talk didn’t go into all the stuff you can do with SMO – that’s a different presentation. This was a way of demonstrating that you can use PowerShell for SMO, as well as everything else you might want from a sysadmin perspective.