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:

image

The preceding command returns the output to the console of the result of the policy evaluation. By default, the particular policy passed to the cmdlet is only checked. In other words, by default, properties are actually changed so that ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.