Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Policy Constructor (PolicyStore, String)

Initializes a new instance of the Policy class.

Namespace:  Microsoft.SqlServer.Management.Dmf
Assembly:  Microsoft.SqlServer.Dmf (in Microsoft.SqlServer.Dmf.dll)

public Policy(
	PolicyStore parent,
	string name
)

Parameters

parent
Type: Microsoft.SqlServer.Management.Dmf.PolicyStore
A PolicyStore object value that specifies the policy store to which the policy belongs.
name
Type: String
A String value that specifies the name of the policy.

C#

Policy p = new Policy(ps, policyName);
p.AutomatedPolicyEvaluationMode = execMode;
p.Condition = condition.Name;
p.ScheduleUid = schedule.ScheduleUid;
if (execMode != AutomatedPolicyEvaluationMode.None) p.Enabled = true;
p.Create();

Community Additions

Show:
© 2015 Microsoft