Policy.Evaluate Method (AdHocPolicyEvaluationMode, Object[])

 

Immediately executes the policy against the specified target objects by using the specified evaluation mode.

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

[STraceConfigurationAttribute(SkipAutoTrace = true)]
public bool Evaluate(
	AdHocPolicyEvaluationMode evaluationMode,
	params object[] targetObjects
)

Parameters

evaluationMode
Type: Microsoft.SqlServer.Management.Dmf.AdHocPolicyEvaluationMode

An AdHocPolicyEvaluationMode object that specifies the evaluation mode to use when the policy executes against the specified target.

targetObjects
Type: System.Object[]

An T:System.Object[] object that specifies target objects.

Return Value

Type: System.Boolean

A Boolean value that verifies whether the policy was executed successfully.

If True, the policy was executed successfully. Otherwise, False.

This ignores all target filters and policy groups. This will throw an exception if the query expression isn’t a single object.

Return to top
Show: