SharePoint servers and PowerPlans

It never struck me before, but if the SQL box is on reduced power,it is going to be a heap slower!
and as we tend to see Win2k8R2 servers now... better check!

https://support.microsoft.com/kb/2207548

' use CSCRIPT to run this...
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set Out = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{025A5937-A6BE-4686-A844-36FE4BEC8B6D}"
strValueName = "PreferredPlan"
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
Out.WriteLine "The REGISTRY key PreferredPlan is: " & strValue
Out.WriteLine " "
Out.WriteLine "WMI calls show:"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2\power")

Set powerPlans = objWMIService.InstancesOf("Win32_PowerPlan")
For Each PowerPlan in PowerPlans
  If PowerPlan.IsActive Then
    Out.WriteLine "Active plan: " & PowerPlan.InstanceID & " '" & PowerPlan.ElementName & "'"
  Else
    Out.WriteLine "Listed plan: " & PowerPlan.InstanceID & " '" & PowerPlan.ElementName & "'"
  End If
Next

 

-----

$preferredPlan = (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{025A5937-A6BE-4686-A844-36FE4BEC8B6D}").PreferredPlan
Write-Output "The REGISTRY key Preferred Plan is: $preferredPlan"
Write-Output " "
Write-Output "WMI calls show:"

$powerPlans = Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power
foreach ($powerPlan in $powerPlans) {
  if ($powerPlan.IsActive) {
    Write-Output ("Active plan: " + $powerPlan.InstanceID + " '" + $PowerPlan.ElementName + "'")
  }
  else {
    Write-Output ("Listed plan: " + $powerPlan.InstanceID + " '" + $PowerPlan.ElementName + "'")
  }
}