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

Definition

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

public:
 Microsoft::SqlServer::Management::Dmf::Policy ^ ImportPolicy(System::Xml::XmlReader ^ xmlReader, Microsoft::SqlServer::Management::Dmf::ImportPolicyEnabledState importEnabledState, bool overwriteExistingPolicy, bool overwriteExistingCondition);
public Microsoft.SqlServer.Management.Dmf.Policy ImportPolicy (System.Xml.XmlReader xmlReader, Microsoft.SqlServer.Management.Dmf.ImportPolicyEnabledState importEnabledState, bool overwriteExistingPolicy, bool overwriteExistingCondition);
Parameters
xmlReader
XmlReader XmlReader

An XmlReader object that specifies the XML reader.

importEnabledState
Microsoft.SqlServer.Management.Dmf.ImportPolicyEnabledState Microsoft.SqlServer.Management.Dmf.ImportPolicyEnabledState

An Microsoft.SqlServer.Management.Dmf.ImportPolicyEnabledState value that specifies whether the import policy is enabled.

overwriteExistingPolicy
Boolean Boolean

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

overwriteExistingCondition
Boolean Boolean

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

Returns

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

Remarks

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

Applies to