PolicyCategory PolicyCategory PolicyCategory Class

Definition

Represents a category that classifies policies in SQL Server Policy-Based Management. Policy Categories are used to group policies together to which target objects can subscribe.

public ref class PolicyCategory sealed : Microsoft::SqlServer::Management::Sdk::Sfc::SfcInstance, Microsoft::SqlServer::Management::Common::IAlterable, Microsoft::SqlServer::Management::Common::ICreatable, Microsoft::SqlServer::Management::Common::IDroppable, Microsoft::SqlServer::Management::Common::IRenamable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcAlterable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcCreatable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcDroppable, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcRenamable
public sealed class PolicyCategory : Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance, Microsoft.SqlServer.Management.Common.IAlterable, Microsoft.SqlServer.Management.Common.ICreatable, Microsoft.SqlServer.Management.Common.IDroppable, Microsoft.SqlServer.Management.Common.IRenamable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcAlterable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcCreatable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcDroppable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcRenamable
Public NotInheritable Class PolicyCategory
Inherits SfcInstance
Implements IAlterable, ICreatable, IDroppable, IRenamable, ISfcAlterable, ISfcCreatable, ISfcDroppable, ISfcRenamable
Inheritance
PolicyCategoryPolicyCategoryPolicyCategory
Implements
Microsoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterable Microsoft.SqlServer.Management.Common.ICreatableMicrosoft.SqlServer.Management.Common.ICreatableMicrosoft.SqlServer.Management.Common.ICreatable Microsoft.SqlServer.Management.Common.IDroppableMicrosoft.SqlServer.Management.Common.IDroppableMicrosoft.SqlServer.Management.Common.IDroppable Microsoft.SqlServer.Management.Common.IRenamableMicrosoft.SqlServer.Management.Common.IRenamableMicrosoft.SqlServer.Management.Common.IRenamable ISfcAlterableISfcAlterableISfcAlterable ISfcCreatableISfcCreatableISfcCreatable ISfcDroppableISfcDroppableISfcDroppable ISfcRenamableISfcRenamableISfcRenamable

Examples

C#

PolicyCategorySubscription policyCatSub = new PolicyCategorySubscription(ps);  
policyCatSub.PolicyCategory = category;  
policyCatSub.TargetType = targetType;  
policyCatSub.Target = targetObject;  
policyCatSub.Create();  

Remarks

Using the PolicyCategory object you can:

  • Create a policy category to which target objects can subscribe.

  • Specify the policy category to use in a subscription

Constructors

PolicyCategory() PolicyCategory() PolicyCategory()

Initializes a new instance of the PolicyCategory class.

PolicyCategory(PolicyStore, String) PolicyCategory(PolicyStore, String) PolicyCategory(PolicyStore, String)

Initializes a new instance of the PolicyCategory class.

Properties

AbstractIdentityKey AbstractIdentityKey AbstractIdentityKey

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

(Inherited from SfcInstance)
DefaultCategory DefaultCategory DefaultCategory

Gets the category to which the policy is assigned by default.

ID ID ID

Gets the ID value that uniquely identifies the policy category.

IdentityKey IdentityKey IdentityKey

Gets the key that uniquely identifies the policy category.

MandateDatabaseSubscriptions MandateDatabaseSubscriptions MandateDatabaseSubscriptions

Gets or sets the Boolean value that determines whether the database subscriptions are permitted.

Metadata Metadata Metadata

Returns metadata about the instance and its domain.

(Inherited from SfcInstance)
Name Name Name

Gets the name of the policy category.

Parent Parent Parent

Gets or sets the parent instance via the keychain.

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)
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()

Updates any PolicyCategory object property changes on the instance of SQL Server.

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)
Create() Create() Create()

Creates a category for the PolicyCategory class.

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)
Discover(ISfcDependencyDiscoveryObjectSink) Discover(ISfcDependencyDiscoveryObjectSink) Discover(ISfcDependencyDiscoveryObjectSink)

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

(Inherited from SfcInstance)
Drop() Drop() Drop()

Removes the policy category from the instance of SQL Server.

DropImpl() DropImpl() DropImpl()

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

(Inherited from SfcInstance)
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)
GetObjectFactory() GetObjectFactory() GetObjectFactory()

Gets the object factory for the object.

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)
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)
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)
Refresh() Refresh() Refresh()

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

(Inherited from SfcInstance)
Rename(String) Rename(String) Rename(String)

Renames the policy.

RenameImpl(SfcKey) RenameImpl(SfcKey) RenameImpl(SfcKey)

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

(Inherited from SfcInstance)
ResetKey() ResetKey() ResetKey()

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

(Inherited from SfcInstance)
Serialize(XmlWriter) Serialize(XmlWriter) Serialize(XmlWriter)

Serializes the instance to XML.

(Inherited from SfcInstance)
ToString() ToString() ToString()

Returns a string representation of the instance Urn.

(Inherited from SfcInstance)
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

ISfcAlterable.ScriptAlter() ISfcAlterable.ScriptAlter() ISfcAlterable.ScriptAlter()

Alters the script that is used to create the policy. Do not reference this member directly in your code. It supports the SQL Server infrastructure..

ISfcCreatable.ScriptCreate() ISfcCreatable.ScriptCreate() ISfcCreatable.ScriptCreate()

Creates a script that is used to create the policy. Do not reference this member directly in your code. It supports the SQL Server infrastructure..

ISfcDroppable.ScriptDrop() ISfcDroppable.ScriptDrop() ISfcDroppable.ScriptDrop()

Drops the script that is used to create the policy. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

ISfcRenamable.Rename(SfcKey) ISfcRenamable.Rename(SfcKey) ISfcRenamable.Rename(SfcKey)

Renames the policy with the specified key.

ISfcRenamable.ScriptRename(SfcKey) ISfcRenamable.ScriptRename(SfcKey) ISfcRenamable.ScriptRename(SfcKey)

Renames the script that is used to create the policy with the specified key.

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