PolicyStore.ImportPolicy Method (XmlReader, ImportPolicyEnabledState, Boolean, Boolean)

 

Imports a single policy and its associated condition from the given XML reader into the policy store.

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

public Policy ImportPolicy(
	XmlReader xmlReader,
	ImportPolicyEnabledState importEnabledState,
	bool overwriteExistingPolicy,
	bool overwriteExistingCondition
)

Parameters

xmlReader
Type: System.Xml.XmlReader

An XmlReader object that specifies the XML reader.

importEnabledState
Type: Microsoft.SqlServer.Management.Dmf.ImportPolicyEnabledState

An ImportPolicyEnabledState value that specifies whether the import policy is enabled.

overwriteExistingPolicy
Type: System.Boolean

A Boolean value that specifies whether the existing policy is overwritten.

overwriteExistingCondition
Type: System.Boolean

A Boolean value that specifies whether the existing condition is overwritten.

Return Value

Type: Microsoft.SqlServer.Management.Dmf.Policy

A single Policy and its associated condition from the given XML reader.

This method throws an exception if a policy or a condition with the same name already exists.

Return to top
Show: