UserPrincipal Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Encapsulates principals that are user accounts.
Assembly: System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)
System.DirectoryServices.AccountManagement.Principal
System.DirectoryServices.AccountManagement.AuthenticablePrincipal
System.DirectoryServices.AccountManagement.UserPrincipal
[<SecurityCriticalAttribute(SecurityCriticalScope.Everything)>] [<DirectoryRdnPrefixAttribute("CN")>] [<DirectoryServicesPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)>] [<DirectoryServicesPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)>] type UserPrincipal = class inherit AuthenticablePrincipal end
Name | Description | |
---|---|---|
![]() | UserPrincipal(PrincipalContext) | Initializes a new instance of the UserPrincipal class by using the specified context. |
![]() | UserPrincipal(PrincipalContext, String, String, Boolean) | Initializes a new instance of the UserPrincipal class by using the specified context, SAM account name, password, and enabled value. |
Name | Description | |
---|---|---|
![]() | AccountExpirationDate | Gets or sets a Nullable DateTime that specifies the date and time that the account expires. (Inherited from AuthenticablePrincipal.) |
![]() | AccountLockoutTime | Gets the Nullable DateTime that specifies the date and time that the account was locked out. (Inherited from AuthenticablePrincipal.) |
![]() | AdvancedSearchFilter | Returns an AdvancedFilters object to set read-only properties before passing the object to the PrincipalSearcher.(Overrides AuthenticablePrincipal.AdvancedSearchFilter.) |
![]() | AllowReversiblePasswordEncryption | Gets or sets a Boolean value that specifies whether reversible password encryption is enabled for this account. (Inherited from AuthenticablePrincipal.) |
![]() | BadLogonCount | Gets the number of logon attempts using incorrect credentials for this account. (Inherited from AuthenticablePrincipal.) |
![]() | Certificates | Gets a X509Certificate2Collection that contains the X509 certificates for this account. (Inherited from AuthenticablePrincipal.) |
![]() | Context | Gets a principal context that is associated with the principal. (Inherited from Principal.) |
![]() | ContextRaw | Gets a principal context that is associated with this principal. (Inherited from Principal.) |
![]() | ContextType | Gets the context type enumeraton value that specifies the type of principal context associated with this principal. (Inherited from Principal.) |
![]() ![]() | Current | Gets a user principal object that represents the current user under which the thread is running. |
![]() | DelegationPermitted | Gets or sets a Nullable Boolean value that specifies whether the account may be delegated. (Inherited from AuthenticablePrincipal.) |
![]() | Description | Gets or sets the description of the principal. (Inherited from Principal.) |
![]() | DisplayName | Gets or sets the display name for this principal.(Inherited from Principal.) |
![]() | DistinguishedName | Gets the distinguished name (DN) for this principal.(Inherited from Principal.) |
![]() | EmailAddress | Gets or sets the e-mail address for this account. |
![]() | EmployeeId | Gets or sets the employee ID for this user principal. |
![]() | Enabled | Gets or sets a Nullable Boolean value that specifies whether this account is enabled for authentication. (Inherited from AuthenticablePrincipal.) |
![]() | GivenName | Gets or sets the given name for the user principal. |
![]() | Guid | Gets the GUID associated with this principal. (Inherited from Principal.) |
![]() | HomeDirectory | Gets or sets the home directory for this account. (Inherited from AuthenticablePrincipal.) |
![]() | HomeDrive | Gets or sets the home drive for this account. (Inherited from AuthenticablePrincipal.) |
![]() | LastBadPasswordAttempt | Gets the Nullable DateTime that specifies the date and time of the last incorrect password attempt on this account. (Inherited from AuthenticablePrincipal.) |
![]() | LastLogon | Gets the Nullable DateTime that specifies the date and time of the last logon for this account. (Inherited from AuthenticablePrincipal.) |
![]() | LastPasswordSet | Gets the Nullable DateTime that specifies the last date and time that the password was set for this account. (Inherited from AuthenticablePrincipal.) |
![]() | MiddleName | Gets or sets the middle name for the user principal. |
![]() | Name | Gets or sets the name of this principal. (Inherited from Principal.) |
![]() | PasswordNeverExpires | Gets or sets a Boolean value that specifies whether the password expires for this account. (Inherited from AuthenticablePrincipal.) |
![]() | PasswordNotRequired | Gets or sets a Boolean value that specifies whether a password is required for this account. (Inherited from AuthenticablePrincipal.) |
![]() | PermittedLogonTimes | Gets or sets the times when the principal can logon. (Inherited from AuthenticablePrincipal.) |
![]() | PermittedWorkstations | Gets the list of workstations that this principal is permitted to log into. (Inherited from AuthenticablePrincipal.) |
![]() | SamAccountName | Gets or sets the SAM account name for this principal. (Inherited from Principal.) |
![]() | ScriptPath | Gets or sets the script path for this account. (Inherited from AuthenticablePrincipal.) |
![]() | Sid | Gets the Security ID (SID) of the principal. (Inherited from Principal.) |
![]() | SmartcardLogonRequired | Gets or sets a Boolean value that specifies whether a smartcard is required to log on to the account. (Inherited from AuthenticablePrincipal.) |
![]() | StructuralObjectClass | Gets the structural object class directory attribute.(Inherited from Principal.) |
![]() | Surname | Gets or sets the surname for the user principal. |
![]() | UserCannotChangePassword | Gets or sets a Boolean value that specifies whether the user can change the password for this account. Do not use this with a ComputerPrincipal.(Inherited from AuthenticablePrincipal.) |
![]() | UserPrincipalName | Gets or sets the user principal name (UPN) associated with this principal. (Inherited from Principal.) |
![]() | VoiceTelephoneNumber | Gets or sets the voice telephone number for the user principal. |
Name | Description | |
---|---|---|
![]() | ChangePassword(String, String) | Changes the account password from the old password to the new password. Do not use this with a ComputerPrincipal.(Inherited from AuthenticablePrincipal.) |
![]() | CheckDisposedOrDeleted() | |
![]() | Delete() | Deletes the principal object from the store. (Inherited from Principal.) |
![]() | Dispose() | |
![]() | Equals(Object) | Returns a Boolean value that specifies whether the supplied object is equal to the current object. (Inherited from Principal.) |
![]() | ExpirePasswordNow() | Expires the password for this account. This will force the user to change his/her password at the next logon.(Inherited from AuthenticablePrincipal.) |
![]() | ExtensionGet(String) | Retrieves an attribute of an extended class object.(Inherited from Principal.) |
![]() | ExtensionSet(String, Object) | Sets the value of an attribute in an extended class.(Inherited from Principal.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() ![]() | FindByBadPasswordAttempt(PrincipalContext, DateTime, MatchType) | Returns a collection of PrincipalSearchResult<'T> objects for users that have an incorrect password attempt recorded in the specified date and time range. |
![]() ![]() | FindByExpirationTime(PrincipalContext, DateTime, MatchType) | Returns a collection of PrincipalSearchResult<'T> objects for users that have an account expiration time in the specified date and time range. |
![]() ![]() | FindByIdentity(PrincipalContext, IdentityType, String) | Returns a user principal object that matches the specified identity type, and value. This version of the FindByIdentity method determines the format of the identity value. |
![]() ![]() | FindByIdentity(PrincipalContext, String) | Returns a user principal object that matches the specified identity value. |
![]() ![]() | FindByLockoutTime(PrincipalContext, DateTime, MatchType) | Returns a collection of PrincipalSearchResult<'T> objects for users that have an account lockout time in the specified date and time range. |
![]() ![]() | FindByLogonTime(PrincipalContext, DateTime, MatchType) | Returns a collection of PrincipalSearchResult<'T> objects for users that have account logon recorded in the specified date and time range. |
![]() ![]() | FindByPasswordSetTime(PrincipalContext, DateTime, MatchType) | Returns a collection of PrincipalSearchResult<'T> objects for users that have set their password within the specified date and time range. |
![]() | GetAuthorizationGroups() | Returns a collection of principal objects that contains all the authorization groups of which this user is a member. This function only returns groups that are security groups; distribution groups are not returned. |
![]() | GetGroups() | Returns a collection of group objects that specify the groups of which the current principal is a member. (Inherited from Principal.) |
![]() | 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. (Inherited from Principal.) |
![]() | 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.(Inherited from Principal.) |
![]() | GetType() | |
![]() | GetUnderlyingObject() | Returns the underlying DirectoryEntry object that provides the contact data for the principal object. (Inherited from Principal.) |
![]() | GetUnderlyingObjectType() | Returns the underlying object type. (Inherited from Principal.) |
![]() | IsAccountLockedOut() | Returns a Boolean value that specifies whether the account is currently locked out. (Inherited from AuthenticablePrincipal.) |
![]() | IsMemberOf(GroupPrincipal) | Returns a Boolean value that specifies whether the principal is a member of the specified group. (Inherited from Principal.) |
![]() | 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. (Inherited from Principal.) |
![]() | MemberwiseClone() | |
![]() | RefreshExpiredPassword() | Refreshes an expired password. (Inherited from AuthenticablePrincipal.) |
![]() | 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.(Inherited from Principal.) |
![]() | 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. (Inherited from Principal.) |
![]() | SetPassword(String) | Sets the account password to the specified value. (Inherited from AuthenticablePrincipal.) |
![]() | ToString() | Returns a user friendly string representation of the current principal object.(Inherited from Principal.) |
![]() | UnlockAccount() | Unlocks the account if it is currently locked out. (Inherited from AuthenticablePrincipal.) |
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