One thing I added to the script was to automate setting the power plan to high performance. You should do this immediately on all of your production SQL Servers if it is not already set. I posted a blog post on how to do it using Windows scripting on the Idera blog: Enabling High Performance Power Plan via Command Line. I talk about why you want to make this configuration change in that post so I won’t repeat it here. I also pointed to a PowerShell script for making that change in that blog post, but when I looked at the script closer, I discovered that it required some manual steps to choose the right plan to enable. So I wrote my own PowerShell script to find the right plan and enable it.
The Script
The script lists all available performance plans (powercfg -l) and finds the unique code for the high performance power plan. It then gets the unique code for the currently active power plan. Lastly, it compares the two unique codes and sets the high performance plan as active if it is not currently the active plan.
Try { $HighPerf = powercfg -l | %{if($_.contains("High performance")) {$_.split()[3]}} $CurrPlan = $(powercfg -getactivescheme).split()[3] if ($CurrPlan -ne $HighPerf) {powercfg -setactive $HighPerf} } Catch { Write-Warning -Message "Unable to set power plan to high performance" }
Kevin M Parks
You should check out the work done by finebuild to automate sql install
http://sqlserverfinebuild.codeplex.com/
SQLSoldier
As Frank said, “I did it my way.” Perhaps others can benefit from checking it out though. Thanks for sharing!
thomas
there is also an alias for the high performance plan, SCHEMA_MIN.
Powercfg -SETACTIVE SCHEME_MIN
SQLSoldier
Thanks! I was not aware of that.
Wayne
Oh, that is so awesome Thomas. I’ve been using something similar to what Robert uses, and this is even better. Thanks for sharing this one!