Configure the General Properties of Policy-Based Management
Applies to: SQL Server
This topic describes how to configure the properties for Policy-Based Management in SQL Server by using SQL Server Management Studio or Transact-SQL.
In This Topic
Before you begin:
To configure Policy-Based Management, using:
Before You Begin
Security
Permissions
Requires membership in the PolicyAdministratorRole fixed database role.
Using SQL Server Management Studio
To configure Policy-Based Management
In Object Explorer, click the plus sign to expand the server where you want to configure Policy-Based Management properties.
Click the plus sign to expand the Management folder.
Right-click Policy Management and select Properties.
The following options are available in Policy Management Properties dialog box.
Enabled
Specifies whether Policy-Based Management is enabled.HistoryRetentionInDays
Specifies the number of days that policy evaluation history should be retained. If this value is 0 (the default), the history will not be automatically removed.LogOnSuccess
Specifies whether Policy-Based Management logs successful policy evaluations.When this value is false (the default), only failed policy evaluations are logged.
When this value is true, both successful and failed policy evaluations are logged.
When finished, click OK.
Using Transact-SQL
To configure Policy-Based Management
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, click New Query.
Copy and paste the following example into the query window and click Execute.
-- enables Policy-Based Management USE msdb; GO EXEC dbo.sp_syspolicy_configure @name = N'Enabled', @value = 1; GO
For more information, see sp_syspolicy_configure (Transact-SQL).
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for