dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Set-DbaPowerPlan

This command sets the SQL Server OS’s Power Plan. It defaults to High Performance which is Best Practice.

If your organization uses a custom power plan that is considered best practice, specify -CustomPowerPlan.

Screenshots

Set-DbaPowerPlan

Examples

To set the Power Plan to High Performance on server sqlserver2014a

Set-DbaPowerPlan -ComputerName sqlserver2014a

To set the Power Plan to the custom power plan called “Maximum Performance”. Skips it if its already set.

Set-DbaPowerPlan -ComputerName sqlcluster -CustomPowerPlan ‘Maximum Performance’

References

Slow Performance on Windows Server when using the “Balanced” Power Plan

Windows Power Plan Effects on Newer Intel Processors by Glenn Berry

Get-Help

From PowerShell, execute Get-Help Set-DbaPowerPlan -Detailed for more information on this function.

Source Code

Want to see the source code? View Set-DbaPowerPlan.ps1 on GitHub
 

Related commands