PolicyStore PolicyStore PolicyStore Class

Definition

The PolicyStore type is the root of the DMF object model.

public ref class PolicyStore sealed : Microsoft::SqlServer::Management::Sdk::Sfc::SfcInstance, Microsoft::SqlServer::Management::Common::IAlterable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcAlterable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcDomain, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcSerializableUpgrade, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcValidate
[System.ComponentModel.TypeConverter(typeof(Microsoft.SqlServer.Management.Sdk.Sfc.LocalizableTypeConverter))]
public sealed class PolicyStore : Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance, Microsoft.SqlServer.Management.Common.IAlterable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcAlterable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcDomain, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcSerializableUpgrade, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcValidate
Public NotInheritable Class PolicyStore
Inherits SfcInstance
Implements IAlterable, ISfcAlterable, ISfcDomain, ISfcSerializableUpgrade, ISfcValidate
Inheritance
PolicyStorePolicyStorePolicyStore
Attributes
Implements
Microsoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterable ISfcAlterableISfcAlterableISfcAlterable ISfcDomainISfcDomainISfcDomain ISfcSerializableUpgradeISfcSerializableUpgradeISfcSerializableUpgrade ISfcValidateISfcValidateISfcValidate

Remarks

Using the PolicyStore object you can:

  • Hold a connection to the whole object model.

  • Access the collection of policies, conditions, policy groups, subscriptions and facets that are immediate children of the PolicyStore object.

  • Review the policy execution history.

  • Review applicable policies for a given target type.

  • Subscribe to policies.

  • Serialize and deserialize policies.

  • Create a policy from a facet.

Note

The PolicyStore class implements ISfcDomain, which specifies the connection point to any object domain defined using the Microsoft SFC.

Constructors

PolicyStore() PolicyStore() PolicyStore()

Initializes a new instance of the PolicyStore class.

PolicyStore(SfcConnection) PolicyStore(SfcConnection) PolicyStore(SfcConnection)

Initializes a new instance of the PolicyStore class with the specified connection object.

Properties

AbstractIdentityKey AbstractIdentityKey AbstractIdentityKey

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
Conditions Conditions Conditions

Represents a collection of Condition objects. Each Condition object represents a policy-based Management condition.

Enabled Enabled Enabled

Gets or sets a value that indicates whether the policy store is enabled.

Facets Facets Facets

Represents a collection of FacetInfo objects. Each FacetInfo object represents a policy-based Management registered facet.

HistoryRetentionInDays HistoryRetentionInDays HistoryRetentionInDays

Gets or sets the number of days the policy store retains history.

IdentityKey IdentityKey IdentityKey

Gets the identity key.

LogOnSuccess LogOnSuccess LogOnSuccess

Gets or sets a value that indicates whether the log-on succeeded.

Metadata Metadata Metadata

Returns metadata about the instance and its domain.

(Inherited from SfcInstance)
Name Name Name

Gets the name of the policy store.

ObjectSets ObjectSets ObjectSets

Represents a collection of ObjectSet objects. Each ObjectSet object represents a policy-based Management object set.

Parent Parent Parent

Gets or sets the instance parent via the keychain.

(Inherited from SfcInstance)
Policies Policies Policies

Represents a collection of Policy objects. Each Policy object represents a policy-based Management policy.

PolicyCategories PolicyCategories PolicyCategories

Represents a collection of PolicyCategory objects. Each PolicyCategory object represents a policy-based Management policy category.

PolicyCategorySubscriptions PolicyCategorySubscriptions PolicyCategorySubscriptions

Represents a collection of PolicyCategorySubscription objects. Each PolicyCategorySubscription object represents a policy-based Management policy category subscription.

Properties Properties Properties

Returns a collection instance properties.

(Inherited from SfcInstance)
PropertyStorageProvider PropertyStorageProvider PropertyStorageProvider

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
SqlStoreConnection SqlStoreConnection SqlStoreConnection

Gets or sets the SqlStoreConnection object.

State State State

Returns the state of the SfcInstance object.

(Inherited from SfcInstance)
Urn Urn Urn

Returns the uniform resource name of the SfcInstance object.

(Inherited from SfcInstance)

Methods

Alter() Alter() Alter()

Alters a previously created PolicyStore object.

AlterImpl() AlterImpl() AlterImpl()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
CheckObjectCreated() CheckObjectCreated() CheckObjectCreated()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
CheckObjectState() CheckObjectState() CheckObjectState()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
CreateIdentityKey() CreateIdentityKey() CreateIdentityKey()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
CreateImpl() CreateImpl() CreateImpl()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
CreatePolicyFromFacet(Object, String, String, String, XmlWriter) CreatePolicyFromFacet(Object, String, String, String, XmlWriter) CreatePolicyFromFacet(Object, String, String, String, XmlWriter)

Creates new policy from an Object and an XmlWriter object.

CreatePolicyFromFacet(SfcQueryExpression, String, String, String) CreatePolicyFromFacet(SfcQueryExpression, String, String, String) CreatePolicyFromFacet(SfcQueryExpression, String, String, String)

Creates a new policy from an SfcQueryExpression object and names.

CreatePolicyFromFacet(SfcQueryExpression, String, String, String, XmlWriter) CreatePolicyFromFacet(SfcQueryExpression, String, String, String, XmlWriter) CreatePolicyFromFacet(SfcQueryExpression, String, String, String, XmlWriter)

Creates a new policy from an SfcQueryExpression object and an XmlWriter object.

DeserializePolicy(XmlReader, Boolean, Boolean) DeserializePolicy(XmlReader, Boolean, Boolean) DeserializePolicy(XmlReader, Boolean, Boolean)

Deserializes a single policy and its associated condition from the specified XML reader into the policy store.

Discover(ISfcDependencyDiscoveryObjectSink) Discover(ISfcDependencyDiscoveryObjectSink) Discover(ISfcDependencyDiscoveryObjectSink)

Discovers policy specified by an ISfcDependencyDiscoveryObjectSink object.

DropImpl() DropImpl() DropImpl()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
EnumApplicablePolicies(SfcQueryExpression) EnumApplicablePolicies(SfcQueryExpression) EnumApplicablePolicies(SfcQueryExpression)

Enumerates policy items specified by an SfcQueryExpression object.

EnumApplicablePolicyCategories(SfcQueryExpression) EnumApplicablePolicyCategories(SfcQueryExpression) EnumApplicablePolicyCategories(SfcQueryExpression)

Enumerates conditions specified by an SfcQueryExpression object.

EnumConditionsOnFacet(String) EnumConditionsOnFacet(String) EnumConditionsOnFacet(String)

Returns a list of conditions that are associated with the specified facet.

EnumConditionsOnFacet(String, PolicyStore+EnumerationMode) EnumConditionsOnFacet(String, PolicyStore+EnumerationMode) EnumConditionsOnFacet(String, PolicyStore+EnumerationMode)

Enumerates a StringCollection of conditions.

EnumDomainFacets(String[]) EnumDomainFacets(String[]) EnumDomainFacets(String[])

Enumerates a collection of FacetInfo objects that represent all facets on the instance of SQL Server.

EnumPoliciesOnFacet(String) EnumPoliciesOnFacet(String) EnumPoliciesOnFacet(String)

Returns a list of policies associated with the specified facet.

EnumPoliciesOnFacet(String, PolicyStore+EnumerationMode) EnumPoliciesOnFacet(String, PolicyStore+EnumerationMode) EnumPoliciesOnFacet(String, PolicyStore+EnumerationMode)

Enumerates policy items on a facet.

EnumPolicyCategories() EnumPolicyCategories() EnumPolicyCategories()

Returns an enumerated list of policy category information.

EnumRootConditions(Type) EnumRootConditions(Type) EnumRootConditions(Type)

Returns a list of root conditions for the specified type.

EnumRootFacets(Type) EnumRootFacets(Type) EnumRootFacets(Type)

Returns a list of root facets for the specified type.

EnumTargetSetConditions(Type) EnumTargetSetConditions(Type) EnumTargetSetConditions(Type)

Returns a list of target set conditions for the specified type.

EnumTargetSetConditions(Type, PolicyStore+EnumerationMode) EnumTargetSetConditions(Type, PolicyStore+EnumerationMode) EnumTargetSetConditions(Type, PolicyStore+EnumerationMode)

Enumerates set conditions on the target.

EraseSystemHealthPhantomRecords() EraseSystemHealthPhantomRecords() EraseSystemHealthPhantomRecords()

Erases system health phantom records specified by a SfcQueryExpression.

GetAggregatedHealthState(SfcQueryExpression) GetAggregatedHealthState(SfcQueryExpression) GetAggregatedHealthState(SfcQueryExpression)

Gets the aggregated health state object of the PolicyStore.

GetChildCollection(String) GetChildCollection(String) GetChildCollection(String)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
GetDomain() GetDomain() GetDomain()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
GetPropertySet() GetPropertySet() GetPropertySet()

Returns the set of properties for the SfcInstance object.

(Inherited from SfcInstance)
GetTypeMetadataImpl() GetTypeMetadataImpl() GetTypeMetadataImpl()

Indicates the domains that override by returning the right TypeMetadata class directly. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
ImportPolicy(XmlReader, ImportPolicyEnabledState, Boolean, Boolean) ImportPolicy(XmlReader, ImportPolicyEnabledState, Boolean, Boolean) ImportPolicy(XmlReader, ImportPolicyEnabledState, Boolean, Boolean)

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

InitializeUIPropertyState() InitializeUIPropertyState() InitializeUIPropertyState()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
MarkForDropImpl(Boolean) MarkForDropImpl(Boolean) MarkForDropImpl(Boolean)

Returns a value that indicates the existing objects to be dropped. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
MarkRootAsConnected() MarkRootAsConnected() MarkRootAsConnected()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
MarkSystemObject(Object, Boolean) MarkSystemObject(Object, Boolean) MarkSystemObject(Object, Boolean)

Sets the name of a Policy, Condition, or ObjectSet.

MoveImpl(SfcInstance) MoveImpl(SfcInstance) MoveImpl(SfcInstance)

Indicates the new parent object to move in an instance. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
OnPropertyMetadataChanges(SfcPropertyMetadataChangedEventArgs) OnPropertyMetadataChanges(SfcPropertyMetadataChangedEventArgs) OnPropertyMetadataChanges(SfcPropertyMetadataChangedEventArgs)

Invoked whenever the effective value of any SfcInstance metadata is updated.

(Inherited from SfcInstance)
OnPropertyValueChanges(PropertyChangedEventArgs) OnPropertyValueChanges(PropertyChangedEventArgs) OnPropertyValueChanges(PropertyChangedEventArgs)

Invoked whenever the effective value of any SfcInstance property is updated.

(Inherited from SfcInstance)
PostAlter(Object) PostAlter(Object) PostAlter(Object)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PostCreate(Object) PostCreate(Object) PostCreate(Object)

Indicates the default implementor that creates the execution result. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PostDrop(Object) PostDrop(Object) PostDrop(Object)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PostMove(Object) PostMove(Object) PostMove(Object)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PostRename(Object) PostRename(Object) PostRename(Object)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PurgeHealthState() PurgeHealthState() PurgeHealthState()

Purges the health data for a specified tree/subtree.

PurgeHealthState(SfcQueryExpression) PurgeHealthState(SfcQueryExpression) PurgeHealthState(SfcQueryExpression)

Removes the health data for a specified tree/subtree.

Refresh() Refresh() Refresh()

Refreshes the object's properties by reading them from the server.

(Inherited from SfcInstance)
RenameImpl(SfcKey) RenameImpl(SfcKey) RenameImpl(SfcKey)

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
RepairPolicyAutomation() RepairPolicyAutomation() RepairPolicyAutomation()

Recreates all necessary artifacts for all automated policies.

ResetKey() ResetKey() ResetKey()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
ScriptAlter() ScriptAlter() ScriptAlter()

Alters the script associated with this policy store.

Serialize(XmlWriter) Serialize(XmlWriter) Serialize(XmlWriter)

Serializes the instance to XML.

(Inherited from SfcInstance)
StartSerializationUpgrade() StartSerializationUpgrade() StartSerializationUpgrade()

Starts a serialization upgrade.

SubscribeToPolicyCategory(SfcQueryExpression, String) SubscribeToPolicyCategory(SfcQueryExpression, String) SubscribeToPolicyCategory(SfcQueryExpression, String)

Indicates the policy store to subscribe to the category specified by the policyCategory and target parameters.

ToString() ToString() ToString()

Returns the PolicyStore object as a string value.

UnsubscribeFromPolicyCategory(SfcQueryExpression, String) UnsubscribeFromPolicyCategory(SfcQueryExpression, String) UnsubscribeFromPolicyCategory(SfcQueryExpression, String)

Unsubscribes the policy store from the category specified by the policyCategory and target parameters.

UpdateUIPropertyState() UpdateUIPropertyState() UpdateUIPropertyState()

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
Validate() Validate() Validate()

Indicates the basic child object's validation. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)

Explicit Interface Implementations

ISfcDomain.GetExecutionEngine() ISfcDomain.GetExecutionEngine() ISfcDomain.GetExecutionEngine()

Gets a new ISfcExecutionEngine object.

ISfcDomain.GetKey(IUrnFragment) ISfcDomain.GetKey(IUrnFragment) ISfcDomain.GetKey(IUrnFragment)

Gets a new SfcKey of type determined by the name property of urnFragment parameter.

ISfcDomain.GetType(String) ISfcDomain.GetType(String) ISfcDomain.GetType(String)

Gets a Type object specified by the typeName parameter.

ISfcDomain.GetTypeMetadata(String) ISfcDomain.GetTypeMetadata(String) ISfcDomain.GetTypeMetadata(String)

Gets a SfcTypeMetadata object identified by the typeName parameter.

ISfcDomain.UseSfcStateManagement() ISfcDomain.UseSfcStateManagement() ISfcDomain.UseSfcStateManagement()

Use the SFC state management to return true.

ISfcDomainLite.DomainInstanceName ISfcDomainLite.DomainInstanceName ISfcDomainLite.DomainInstanceName

Gets the domain instance name.

ISfcDomainLite.DomainName ISfcDomainLite.DomainName ISfcDomainLite.DomainName

Gets the domain name for the object.

ISfcDomainLite.GetLogicalVersion() ISfcDomainLite.GetLogicalVersion() ISfcDomainLite.GetLogicalVersion()

Indicates the logical version to get in the domain.

ISfcHasConnection.ConnectionContext ISfcHasConnection.ConnectionContext ISfcHasConnection.ConnectionContext

Gets the connection context.

ISfcHasConnection.GetConnection() ISfcHasConnection.GetConnection() ISfcHasConnection.GetConnection()

Indicates the connection to get.

ISfcHasConnection.GetConnection(SfcObjectQueryMode) ISfcHasConnection.GetConnection(SfcObjectQueryMode) ISfcHasConnection.GetConnection(SfcObjectQueryMode)

Indicates the connection to get using the SfcObjectQuery mode.

ISfcHasConnection.SetConnection(ISfcConnection) ISfcHasConnection.SetConnection(ISfcConnection) ISfcHasConnection.SetConnection(ISfcConnection)

Indicates the connection to set.

ISfcValidate.Validate(String, Object[]) ISfcValidate.Validate(String, Object[]) ISfcValidate.Validate(String, Object[])

Validates the Policy objects in the PolicyStore.

Events

propertyChanged propertyChanged propertyChanged

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SfcInstance)
PropertyChanged PropertyChanged PropertyChanged

Occurs when a property value changes.

(Inherited from SfcInstance)
propertyMetadataChanged propertyMetadataChanged propertyMetadataChanged

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

Occurs when a property metadata value changes.

(Inherited from SfcInstance)
PropertyMetadataChanged PropertyMetadataChanged PropertyMetadataChanged

Occurs when the metadata for a property has changed.

(Inherited from SfcInstance)

Applies to