O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cmdlet Example: Invoke-PolicyEvaluation

Another one of the provided cmdlets is Invoke-PolicyEvaluation. This cmdlet is used to specify a SQL Server Policy-Based Management policy (or policies) that will be evaluated against the target server. You can easily cycle through all the available policies and evaluate each one, or simply provide a list of policies to evaluate separated by a comma. Consider this example:

sl "C:\Program Files\Microsoft SQL Server\110\Tools\Policies\DatabaseEngine\1033"Invoke-PolicyEvaluation -Policy "Database Auto Shrink.xml" -TargetServerName"MSSQLSERVER"

The preceding command returns the output to the console of the result of the policy evaluation. By default, the particular policy passed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required