Principal Principal Principal Principal Class

Definition

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

public ref class Principal abstract : IDisposable
public abstract class Principal : IDisposable
type Principal = class
    interface IDisposable
Public MustInherit Class Principal
Implements IDisposable
Inheritance
PrincipalPrincipalPrincipalPrincipal
Derived
Implements

Remarks

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.

Constructors

Principal() Principal() Principal() Principal()

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.

Properties

Context Context Context Context

Gets a principal context that is associated with the principal.

ContextRaw ContextRaw ContextRaw ContextRaw

Gets a principal context that is associated with this principal.

ContextType ContextType ContextType ContextType

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

Description Description Description Description

Gets or sets the description of the principal.

DisplayName DisplayName DisplayName DisplayName

Gets or sets the display name for this principal.

DistinguishedName DistinguishedName DistinguishedName DistinguishedName

Gets the distinguished name (DN) for this principal.

Guid Guid Guid Guid

Gets the GUID associated with this principal.

Name Name Name Name

Gets or sets the name of this principal.

SamAccountName SamAccountName SamAccountName SamAccountName

Gets or sets the SAM account name for this principal.

Sid Sid Sid Sid

Gets the Security ID (SID) of the principal.

StructuralObjectClass StructuralObjectClass StructuralObjectClass StructuralObjectClass

Gets the structural object class directory attribute.

UserPrincipalName UserPrincipalName UserPrincipalName UserPrincipalName

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

Methods

CheckDisposedOrDeleted() CheckDisposedOrDeleted() CheckDisposedOrDeleted() CheckDisposedOrDeleted()

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.

Delete() Delete() Delete() Delete()

Deletes the principal object from the store.

Dispose() Dispose() Dispose() Dispose()

Disposes the current instance of the Principal object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Returns a Boolean value that specifies whether the supplied object is equal to the current object.

ExtensionGet(String) ExtensionGet(String) ExtensionGet(String) ExtensionGet(String)

Retrieves an attribute of an extended class object.

ExtensionSet(String, Object) ExtensionSet(String, Object) ExtensionSet(String, Object) ExtensionSet(String, Object)

Sets the value of an attribute in an extended class.

FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String) FindByIdentity(PrincipalContext, IdentityType, String)

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

FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String) FindByIdentity(PrincipalContext, String)

Returns a principal object that matches the specified identity value.

FindByIdentityWithType(PrincipalContext, Type, IdentityType, String) FindByIdentityWithType(PrincipalContext, Type, IdentityType, String) FindByIdentityWithType(PrincipalContext, Type, IdentityType, String) FindByIdentityWithType(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.

FindByIdentityWithType(PrincipalContext, Type, String) FindByIdentityWithType(PrincipalContext, Type, String) FindByIdentityWithType(PrincipalContext, Type, String) FindByIdentityWithType(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.

GetGroups() GetGroups() GetGroups() GetGroups()

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

GetGroups(PrincipalContext) GetGroups(PrincipalContext) GetGroups(PrincipalContext) GetGroups(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.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUnderlyingObject() GetUnderlyingObject() GetUnderlyingObject() GetUnderlyingObject()

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

GetUnderlyingObjectType() GetUnderlyingObjectType() GetUnderlyingObjectType() GetUnderlyingObjectType()

Returns the underlying object type.

IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal) IsMemberOf(GroupPrincipal)

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

IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String) IsMemberOf(PrincipalContext, IdentityType, String)

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

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Save() Save() Save() Save()

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.

Save(PrincipalContext) Save(PrincipalContext) Save(PrincipalContext) Save(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.

ToString() ToString() ToString() ToString()

Returns a user friendly string representation of the current principal object.

Applies to