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


Powershell for DBAs


Powershell for DBAs

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)

Group: Administrators
Points: 61415 Visits: 19097
Comments posted to this topic are about the item Powershell for DBAs

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
jjwillemen
jjwillemen
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 11
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.
william-700725
william-700725
SSC Journeyman
SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)

Group: General Forum Members
Points: 80 Visits: 181
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.
Mad Hacker
Mad Hacker
Right there with Babe
Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)Right there with Babe (756 reputation)

Group: General Forum Members
Points: 756 Visits: 414
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.



Peter Schott
Peter Schott
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1463 Visits: 1918
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.
David Conn
David Conn
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3143 Visits: 1148
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
Gary Varga
Gary Varga
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16042 Visits: 6531
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!!!
william-700725
william-700725
SSC Journeyman
SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)

Group: General Forum Members
Points: 80 Visits: 181
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?
Gary Varga
Gary Varga
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16042 Visits: 6531
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!!!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search