In this task, you will use Object Explorer to perform an on-demand evaluation of best practices policies for the SQL Server Database Engine on a single instance of SQL Server.
You can also evaluate policies on a single instance through Registered Servers. For more information, see Perform an On-Demand Evaluation by Using Registered Servers.
This lesson is based on the version of SQL Server Management Studio from SQL Server 2014.
To perform an on-demand evaluation of best practices policies against instances that are running SQL Server 2005, you must use the procedure in the topic Perform an On-Demand Evaluation by Using Registered Servers.
To perform an on-demand evaluation by using Object Explorer
Start Management Studio, and then connect to the Database Engine.
In Object Explorer, expand Management, expand Policy Management, right-click Policies, and then click Evaluate.
By default, the local instance is used as the source of the policies. If you have previously imported best practices policies, they will be listed, together with any other policies that you have created. You can select any of the imported best practices policies, and then click Evaluate. If you have not imported the best practices policies, continue with this procedure.
In the Evaluate Policies dialog box, next to the Source box, click the ellipsis (…) button.
In the Select Source dialog box, you can select either Files or Server as the source of the policy files to evaluate. If you click Server, you can perform an on-demand evaluation of any best practices policies that were previously imported into Policy-Based Management on a local or remote server. In this tutorial, you will click Files, and then select the individual policy files that you want to evaluate. To do this, follow these steps:
Next to Files, click the ellipsis (…) button.
In the Select Policy dialog box, browse to the following folder, which contains the best practices policies:
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Policies\DatabaseEngine\1033
The file path may vary, depending on where you installed the SQL Server program files, whether you are running a 32-bit or 64-bit operating system, and the language identifier.
Select one or more .xml policy files to evaluate, and then click Open.
The list of selected files appears in the Files box.
In the Select Source dialog box, click OK.
If the Loading Policies dialog box appears, click Close.
The policies that you selected are listed on the Policy Selection page. Be aware that a warning icon next to a policy indicates that the policy contains scripts.
Click Evaluate to evaluate the policies.
In the Results table, the results for each policy are listed. A red "x" icon indicates that policy compliance failed.
For some policy failures, Policy-Based Management enables you to immediately enforce policy compliance on the target. For such failures, a check box will appear next to the failed policy. If you select the check box, the Apply button becomes available. When you click Apply, the noncompliant setting will be automatically updated on the target instance.
Make sure that you fully understand the policy setting before automatically updating a target instance. We recommend that after you select one or more check boxes, you click Script, and choose an output location so that you can review the underlying Transact-SQL code before you apply the changes.
To view detailed results for a policy, click the policy in the Results table.