Compartir a través de


PolicyStore.DeserializePolicy(XmlReader, Boolean, Boolean) Method

Definition

Deserialize a single policy from the given XML reader. The reader should be previously created by a supported Export method. The deserialized Policy exists in-memory only and must be created in the PolicyStore on the server to persist it.

public Microsoft.SqlServer.Management.Dmf.Policy DeserializePolicy (System.Xml.XmlReader xmlReader, bool overwriteExistingPolicy, bool overwriteExistingCondition);
member this.DeserializePolicy : System.Xml.XmlReader * bool * bool -> Microsoft.SqlServer.Management.Dmf.Policy
Public Function DeserializePolicy (xmlReader As XmlReader, overwriteExistingPolicy As Boolean, overwriteExistingCondition As Boolean) As Policy

Parameters

xmlReader
XmlReader

The XML reader to import from.

overwriteExistingPolicy
Boolean

If true, then if a Policy of the same name already exists in the Store then it will be overwritten.

overwriteExistingCondition
Boolean

If true, then if any Condition associated with the Policy, either directly or through a TargetSet already exists in the Store then it will be overwritten.

Returns

The Policy object imported. If the XML reader fails to validate properly it may throw an exception.

Applies to