commands

^

Test-DbaPowerPlan

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Test-DbaPowerPlan on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaPowerPlan.

Synopsis

Checks the Power Plan settings for compliance with best practices, which recommend High Performance for SQL Server.

Description

Checks the Power Plan settings on a computer against best practices recommendations.
Each server's name, the active and the recommended Power Plan and an IsBestPractice field are returned.

If your organization uses a different Power Plan that is considered best practice, specify -PowerPlan.

References:
https://support.microsoft.com/en-us/kb/2207548
http://www.sqlskills.com/blogs/glenn/windows-power-plan-effects-on-newer-intel-processors/

Syntax

Test-DbaPowerPlan
    [-ComputerName] <DbaInstanceParameter[]>
    [[-Credential] <PSCredential>]
    [[-PowerPlan] <String>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Test-DbaPowerPlan -ComputerName sqlserver2014a

Checks the Power Plan settings for sqlserver2014a and indicates whether or not it complies with best practices.

Example: 2
PS C:\> Test-DbaPowerPlan -ComputerName sqlserver2014a -PowerPlan 'Maximum Performance'

Checks the Power Plan settings for sqlserver2014a and indicates whether or not it is set to the Power Plan "Maximum Performance".

Example: 3
PS C:\> 'newserver1', 'newserver2' | Test-DbaPowerPlan

Checks the Power Plan settings for newserver1 and newserver2 and indicates whether or not they comply with best practices.

Example: 4
PS C:\> Get-DbaPowerPlan -ComputerName oldserver | Test-DbaPowerPlan -ComputerName newserver1, newserver2

Uses the Power Plan of oldserver as best practice and tests the Power Plan of newserver1 and newserver2 against that.

Required Parameters

-ComputerName

The server(s) to check Power Plan settings on.

Alias
Required True
Pipeline true (ByValue, ByPropertyName)
Default Value

Optional Parameters

-Credential

Specifies a PSCredential object to use in authenticating to the server(s), instead of the current user account.

Alias
Required False
Pipeline true (ByPropertyName)
Default Value
-PowerPlan

If your organization uses a different power plan that's considered best practice, specify it here.

Alias CustomPowerPlan
Required False
Pipeline true (ByPropertyName)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False