Powershell for DBAs

  • Comments posted to this topic are about the item Powershell for DBAs

  • Hi Steve,

    Just want to say: don't underestimate!

    Apart from Microsoft "pushing", major companies like VMWare, Cisco, Citrix, NetApp, Dell and HP have started to offer Powershell interfaces to their main products. Might grow into a real cross platform IT Administration language.

  • In my (rarely humble) opinion, Powershell proficiency is a skill any DBA working with Windows-based servers should acquire. If you have any task that would benefit from automation, it can almost certainly be scripted using Powershell -- Powershell does more than just fill the shell-scripting gap left by Microsoft's abandonment of VBScript, it is as clear an improvement over VBScript as VBScript was over command-shell batch language.

    As just one example, I am steadily replacing SSIS packages with Powershell scripts for improved maintainability. Between being able to actually read the logic in a single interface and having much clearer debugging, working with .dstx files in a Visual Studio plug-in seems positively painful in comparison.

    For another example, I'm able to use Powershell to automatically synchronize the contents of several file structures on geographically dispersed servers with minimal effort (roughly 3 dozen lines of very readable Powershell code does the trick). And I'm just getting started finding production uses for Powershell.

  • You can add me to the list of POSH believers. I finally got around to looking at it about a year ago and I can honestly say that I regret not looking at it much sooner. I highly recommend the books Learn Powershell in a Month of Lunches and Powershell Toolmaking in a Month of Lunches by Don Jones. I found both books easy to follow and extremely helpful and they facilitated me in getting up and running in a very short period of time.

    In only the last year, I've written Powershell scripts to perform the following tasks:

    - Report System Inventory

    - Monitor SQL Server Performance

    - Scramble sensative data for use in a demo

    - SQL Server Provisioning

    Powershell scripting can make the life of a DBA much easier, and as an added bonus it should translate nicely to a traditional I.T. environment futher leveraging your skillset.

  • I see the potential for Powershell, but I'll admit I'm in Steve's camp. I have a lot of ad-hoc queries and processes that I run much more often than I run things that need to be repeated or run across a bunch of servers. For me, Powershell as a daily use doesn't make as much sense. However, I've used it to easily encrypt/decrypt data, move files around, FTP, launch other processes, and so on. Those are definitely the exceptions for me. It's still in my list of tools to use, but much more sparingly than I use T-SQL in SSMS because of the nature of my work.

  • I really want to learn Powershell but until I have a Problem that Powershell solves for me then it just fits into the category of a Solution waiting for a Problem.

    David

  • I am a long time fan of PowerShell but we must also realise that we should be applying the right tools for the right jobs. I have seen examples of people trying to write applications in PowerShell or even ETL tasks. In my opinion neither are appropriate uses of PowerShell.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Really? Why not? There are countless open-source applications written in other scripting languages (perl, php, Python).

    And what makes ETL in particular unsuitable for scripting?

  • I am not convinced that using PowerShell for these scenarios is applying the most appropriate tool. I am certain that given any description I provide that someone could come up with at least an exception, however, in principle I do not think that it is the best tool for these cases. Of course, this is what usually counts as a guideline as opposed to a rule.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply