Delen via


How to: Export and Import a Policy-Based Management Policy

Policy-Based Management policies are installed on an instance of the SQL Server Database Engine. A policy with its condition can be exported to an XML file, and imported from an XML file to another instance of SQL Server.

This topic demonstrates how to export a policy and then import a policy.

To export a Policy-Based Management policy

  1. In Object Explorer, expand Management, expand Policy Management, Policies, right-click a policy, and then click ExportPolicy.

  2. In the Export Policy dialog box, type the path and name of the file; or use the Browse (...) button to locate the file, and then type the name of the XML file.

  3. Click Save.

To import a Policy-Based Management policy instance

  1. In Object Explorer, expand Management, expand Policy Management, right-click Policies, and then click Import Policy.

  2. In the Import dialog box, type the path and name of the file; or use the Browse (...) button to locate the XML file that contains the policy, and then select the file.

  3. Click Open and then click OK.

    Note

    SQL Server ships with policies that can be used to monitor an instance of SQL Server. By default, these policies are not installed on the SQL Server Database Engine, but they can be imported from the default location of C:\Program Files\Microsoft SQL Server\100\Tools\Policies\DatabaseEngine\1033.

Security

Requires membership in the PolicyAdministratorRole role in the msdb database.