Principal Class

 

Encapsulates the account data and operations common to all security principals. This is the abstract base class from which all security principals are derived.

Namespace:   System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)


[DirectoryServicesPermissionAttribute(SecurityAction.LinkDemand, 
	Unrestricted = true)]
[DirectoryServicesPermissionAttribute(SecurityAction.InheritanceDemand, 
	Unrestricted = true)]
public abstract class Principal : IDisposable

NameDescription
System_CAPS_protmethodPrincipal()

Initializes a new instance of the Principal class. This constructor is called by derived-class constructors to initialize the base class and is not intended to be called directly from your code.

NameDescription
System_CAPS_pubpropertyContext

Gets a principal context that is associated with the principal.

System_CAPS_protpropertyContextRaw

Gets a principal context that is associated with this principal.

System_CAPS_pubpropertyContextType

Gets the context type enumeraton value that specifies the type of principal context associated with this principal.

System_CAPS_pubpropertyDescription

Gets or sets the description of the principal.

System_CAPS_pubpropertyDisplayName

Gets or sets the display name for this principal.

System_CAPS_pubpropertyDistinguishedName

Gets the distinguished name (DN) for this principal.

System_CAPS_pubpropertyGuid

Gets the GUID associated with this principal.

System_CAPS_pubpropertyName

Gets or sets the name of this principal.

System_CAPS_pubpropertySamAccountName

Gets or sets the SAM account name for this principal.

System_CAPS_pubpropertySid

Gets the Security ID (SID) of the principal.

System_CAPS_pubpropertyStructuralObjectClass

Gets the structural object class directory attribute.

System_CAPS_pubpropertyUserPrincipalName

Gets or sets the user principal name (UPN) associated with this principal.

NameDescription
System_CAPS_protmethodCheckDisposedOrDeleted()

Determines whether the Dispose or Delete methods have been called on this class. This method is called by classes that derive from this principal class.

System_CAPS_pubmethodDelete()

Deletes the principal object from the store.

System_CAPS_pubmethodDispose()

Disposes the current instance of the Principal object.

System_CAPS_pubmethodEquals(Object)

Returns a Boolean value that specifies whether the supplied object is equal to the current object. (Overrides Object.Equals(Object).)

System_CAPS_protmethodExtensionGet(String)

Retrieves an attribute of an extended class object.

System_CAPS_protmethodExtensionSet(String, Object)

Sets the value of an attribute in an extended class.

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticFindByIdentity(PrincipalContext, IdentityType, String)

Returns a principal object that matches the specified identity type, and value. This version of the FindByIdentity method determines the format of the identity value.

System_CAPS_pubmethodSystem_CAPS_staticFindByIdentity(PrincipalContext, String)

Returns a principal object that matches the specified identity value.

System_CAPS_protmethodSystem_CAPS_staticFindByIdentityWithType(PrincipalContext, Type, IdentityType, String)

Returns a principal object that matches the specified identity type, and value. This method is called by the implementation of the derived-class FindByIdentity method to restrict the search to the derived class type and is not intended to be called directly from your code.

System_CAPS_protmethodSystem_CAPS_staticFindByIdentityWithType(PrincipalContext, Type, String)

Returns a principal object that matches the specified identity type, and value. This method is called by the implementation of the derived-class FindByIdentity method to restrict the search to the derived class type and is not intended to be called directly from your code.

System_CAPS_pubmethodGetGroups()

Returns a collection of group objects that specify the groups of which the current principal is a member.

System_CAPS_pubmethodGetGroups(PrincipalContext)

Returns a collection of group objects that the principal is a member of and that exist in the store provided by the specified context parameter.

System_CAPS_pubmethodGetHashCode()

Retrieves the hash created from the contents of the principal object, suited for use in hashing algorithms and data structures like a hash table.(Overrides Object.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetUnderlyingObject()

Returns the underlying DirectoryEntry object that provides the contact data for the principal object.

System_CAPS_pubmethodGetUnderlyingObjectType()

Returns the underlying object type.

System_CAPS_pubmethodIsMemberOf(GroupPrincipal)

Returns a Boolean value that specifies whether the principal is a member of the specified group.

System_CAPS_pubmethodIsMemberOf(PrincipalContext, IdentityType, String)

Returns a Boolean value that specifies whether the principal is a member of the group specified by identity type and value.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSave()

Saves the changes that were made on the principal object to the store. If this is a new principal object, this method inserts it into the store.

System_CAPS_pubmethodSave(PrincipalContext)

Saves the changes that were made on the principal object to the store. If this is a new principal object, this method inserts it into the specified context. If the principal has already been persisted, it is moved from the original context to the specified context.

System_CAPS_pubmethodToString()

Returns a user friendly string representation of the current principal object.(Overrides Object.ToString().)

Custom extension classes that derive from this class can call this constructor from the derived class constructor to initialize the base class. For more information, see the Principal Extensions overview topic.

.NET Framework
Available since 3.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

System.DirectoryServices.AccountManagement
System.DirectoryServices.AccountManagement Namespace Overview

Return to top
Show: