If you haven’t seen some of the other blog post, or the Microsoft Powershell Blog, Microsoft recently release Script Browser for Powershell ISE. This little addin allows you to quickly search and import Powershell scripts directly from TechNet Script Center. Currently the database section has 577 scripts in the repository, with over 9100 in the total repository. There’s a pretty good chance that someone has a script for what you want to do. Alternatively, if you are just getting started with Powershell, this is a great way to review others scripts and learn.
Try this, have you ever wanted to resize your TempDB to recommended number of files and sizes? Search for ‘TempDB’ You should come up with Resize the TempDB database using PowerShell from my coworker, Michael Wells (b | t). Michael presents this as a function that will output the T-SQL to resize your TempDB. Combine this with the better Invoke-SqlCmd2 from Powershell MVP Chad Miller (b) and you could easily loop and apply this to all your SQL Servers. (Note: I do not recommend resizing TempDB like this on existing servers, we use this script to setup new servers to a standard base level)
Speaking of new servers, you can combine the vast array of scripts available from the script center, with the power of SPADE for SQL Server, also by Michael Wells, to automate the deployment of your SQL Servers. With this combination and alittle time for getting things setup properly, you can easily end up fully standardized SQL Servers in a matter of minutes. Since I work with Michael, I have used SPADE extensively, as well as wrote Powershell scripts for it to run, needless to say, I am a big fan of the project. Guestimating the number of installs I’ve done with SPADE, I ended up somewhere around 300 installs over the last year. It is an awesome tool, if you haven’t picked up on that from this paragraph.
If you use Powershell, check out these tools. If Powershell isn’t currently in your tool belt, I highly recommending getting started.