UserPrincipal 类
定义
封装作为用户帐户的主体。Encapsulates principals that are user accounts.
public ref class UserPrincipal : System::DirectoryServices::AccountManagement::AuthenticablePrincipal
[System.DirectoryServices.AccountManagement.DirectoryRdnPrefix("CN")]
public class UserPrincipal : System.DirectoryServices.AccountManagement.AuthenticablePrincipal
[System.DirectoryServices.AccountManagement.DirectoryRdnPrefix("CN")]
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class UserPrincipal : System.DirectoryServices.AccountManagement.AuthenticablePrincipal
[<System.DirectoryServices.AccountManagement.DirectoryRdnPrefix("CN")>]
type UserPrincipal = class
inherit AuthenticablePrincipal
[<System.DirectoryServices.AccountManagement.DirectoryRdnPrefix("CN")>]
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type UserPrincipal = class
inherit AuthenticablePrincipal
Public Class UserPrincipal
Inherits AuthenticablePrincipal
- 继承
- 属性
构造函数
| UserPrincipal(PrincipalContext) |
使用指定的上下文初始化 UserPrincipal 类的新实例。Initializes a new instance of the UserPrincipal class by using the specified context. |
| UserPrincipal(PrincipalContext, String, String, Boolean) |
使用指定的上下文、SAM 帐户名、密码和启用的值初始化 UserPrincipal 类的新实例。Initializes a new instance of the UserPrincipal class by using the specified context, SAM account name, password, and enabled value. |
属性
| AccountExpirationDate |
获取或设置一个可以为 null 的 DateTime,用于指定帐户过期的日期和时间。Gets or sets a Nullable DateTime that specifies the date and time that the account expires. (继承自 AuthenticablePrincipal) |
| AccountLockoutTime |
获取一个可以为 null 的 DateTime,用于指定帐户被锁定的日期和时间。Gets the Nullable DateTime that specifies the date and time that the account was locked out. (继承自 AuthenticablePrincipal) |
| AdvancedSearchFilter |
在将对象传递给 PrincipalSearcher 之前,返回 AdvancedFilters 对象以设置只读属性。Returns an AdvancedFilters object to set read-only properties before passing the object to the PrincipalSearcher. |
| AllowReversiblePasswordEncryption |
获取或设置一个布尔值,该值指定是否为此帐户启用可逆密码加密。Gets or sets a Boolean value that specifies whether reversible password encryption is enabled for this account. (继承自 AuthenticablePrincipal) |
| BadLogonCount |
获取对此帐户使用不正确的凭据进行登录的尝试次数。Gets the number of logon attempts using incorrect credentials for this account. (继承自 AuthenticablePrincipal) |
| Certificates |
获取包含此账户的 X509 证书的 X509Certificate2Collection。Gets a X509Certificate2Collection that contains the X509 certificates for this account. (继承自 AuthenticablePrincipal) |
| Context |
获取与主体关联的主体上下文。Gets a principal context that is associated with the principal. (继承自 Principal) |
| ContextRaw |
获取与此主体关联的主体上下文。Gets a principal context that is associated with this principal. (继承自 Principal) |
| ContextType |
获取上下文类型枚举值,该值指定与此主体关联的主体上下文的类型。Gets the context type enumeration value that specifies the type of principal context associated with this principal. (继承自 Principal) |
| Current |
获取一个用户主体对象,该对象表示运行线程的当前用户。Gets a user principal object that represents the current user under which the thread is running. |
| DelegationPermitted |
获取或设置一个可以为 null 的布尔值,该值指定是否可以委托帐户。Gets or sets a Nullable Boolean value that specifies whether the account may be delegated. (继承自 AuthenticablePrincipal) |
| Description |
获取或设置主体的说明。Gets or sets the description of the principal. (继承自 Principal) |
| DisplayName |
获取或设置此主体的显示名称。Gets or sets the display name for this principal. (继承自 Principal) |
| DistinguishedName |
获取此主体的可分辨名称 (DN)。Gets the distinguished name (DN) for this principal. (继承自 Principal) |
| EmailAddress |
获取或设置此帐户的电子邮件地址。Gets or sets the email address for this account. |
| EmployeeId |
获取或设置此用户主体的雇员 ID。Gets or sets the employee ID for this user principal. |
| Enabled |
获取或设置一个可以为 null 的布尔值,该值指定是否支持此帐户进行身份验证。Gets or sets a Nullable Boolean value that specifies whether this account is enabled for authentication. (继承自 AuthenticablePrincipal) |
| GivenName |
获取或设置用户主体的名字。Gets or sets the given name for the user principal. |
| Guid |
获取与此主体关联的 GUID。Gets the GUID associated with this principal. (继承自 Principal) |
| HomeDirectory |
获取或设置此帐户的主目录。Gets or sets the home directory for this account. (继承自 AuthenticablePrincipal) |
| HomeDrive |
获取或设置此帐户的主驱动器。Gets or sets the home drive for this account. (继承自 AuthenticablePrincipal) |
| LastBadPasswordAttempt |
获取一个可以为 null 的 DateTime,用于指定最后一次对此帐户进行不正确的密码尝试的日期和时间。Gets the Nullable DateTime that specifies the date and time of the last incorrect password attempt on this account. (继承自 AuthenticablePrincipal) |
| LastLogon |
获取一个可以为 null 的 DateTime,用于指定最后一次登录此帐户的日期和时间。Gets the Nullable DateTime that specifies the date and time of the last logon for this account. (继承自 AuthenticablePrincipal) |
| LastPasswordSet |
获取一个可以为 null 的 DateTime,用于指定最后一次为此帐户设置密码的日期和时间。Gets the Nullable DateTime that specifies the last date and time that the password was set for this account. (继承自 AuthenticablePrincipal) |
| MiddleName |
获取或设置用户主体的中间名。Gets or sets the middle name for the user principal. |
| Name |
获取或设置此主体的名称。Gets or sets the name of this principal. (继承自 Principal) |
| PasswordNeverExpires |
获取或设置一个布尔值,该值指定此帐户的密码是否会过期。Gets or sets a Boolean value that specifies whether the password expires for this account. (继承自 AuthenticablePrincipal) |
| PasswordNotRequired |
获取或设置一个布尔值,该值指定此帐户是否需要密码。Gets or sets a Boolean value that specifies whether a password is required for this account. (继承自 AuthenticablePrincipal) |
| PermittedLogonTimes |
获取或设置主体可以登录的次数。Gets or sets the times when the principal can logon. (继承自 AuthenticablePrincipal) |
| PermittedWorkstations |
获取允许此主体登录的工作站的列表。Gets the list of workstations that this principal is permitted to log into. (继承自 AuthenticablePrincipal) |
| SamAccountName |
获取或设置此主体的 SAM 帐户名。Gets or sets the SAM account name for this principal. (继承自 Principal) |
| ScriptPath |
获取或设置此帐户的脚本路径。Gets or sets the script path for this account. (继承自 AuthenticablePrincipal) |
| Sid |
获取主体的安全 ID (SID)。Gets the Security ID (SID) of the principal. (继承自 Principal) |
| SmartcardLogonRequired |
获取或设置一个布尔值,该值指定登录帐户是否需要智能卡。Gets or sets a Boolean value that specifies whether a smartcard is required to log on to the account. (继承自 AuthenticablePrincipal) |
| StructuralObjectClass |
获取结构对象类目录特性。Gets the structural object class directory attribute. (继承自 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. 请勿将其与 ComputerPrincipal 一起使用。Do not use this with a ComputerPrincipal. (继承自 AuthenticablePrincipal) |
| UserPrincipalName |
获取或设置与此主体关联的用户主体名称 (UPN)。Gets or sets the user principal name (UPN) associated with this principal. (继承自 Principal) |
| VoiceTelephoneNumber |
获取或设置用户主体的语音电话号码。Gets or sets the voice telephone number for the user principal. |
方法
| ChangePassword(String, String) |
将帐户旧密码更改为新密码。Changes the account password from the old password to the new password. 请勿将其与 ComputerPrincipal 一起使用。Do not use this with a ComputerPrincipal. (继承自 AuthenticablePrincipal) |
| CheckDisposedOrDeleted() |
确定是否已对此类调用 Dispose() 或 Delete() 方法。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. (继承自 Principal) |
| Delete() |
从存储区中删除主体对象。Deletes the principal object from the store. (继承自 Principal) |
| Dispose() |
处置 Principal 对象的当前实例。Disposes the current instance of the Principal object. (继承自 Principal) |
| Equals(Object) |
返回一个布尔值,该值指定提供的对象是否等于当前对象。Returns a Boolean value that specifies whether the supplied object is equal to the current object. (继承自 Principal) |
| ExpirePasswordNow() |
使此帐户的密码过期。Expires the password for this account. 这会强制用户在下次登录时更改其密码。This will force the user to change his/her password at the next logon. (继承自 AuthenticablePrincipal) |
| ExtensionGet(String) |
检索扩展类对象的属性。Retrieves an attribute of an extended class object. (继承自 Principal) |
| ExtensionSet(String, Object) |
设置扩展类中特性的值。Sets the value of an attribute in an extended class. (继承自 Principal) |
| FindByBadPasswordAttempt(PrincipalContext, DateTime, MatchType) |
对于在指定日期和时间范围内有错误密码尝试记录的用户,返回 PrincipalSearchResult<T> 对象集合。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) |
返回用户的 PrincipalSearchResult<T> 对象集合,其具有指定日期和时间范围内的帐户过期时间。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. 此版本的 FindByIdentity 方法确定标识值的格式。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) |
对于具有指定日期和时间范围内的帐户锁定时间的用户,返回 PrincipalSearchResult<T> 对象集合。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) |
为用户返回 PrincipalSearchResult<T> 对象的集合,这些用户在指定日期和时间范围内记录帐户登录。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) |
返回用户的 PrincipalSearchResult<T> 对象集合,该用户在指定日期和时间范围内设置了密码。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. (继承自 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. (继承自 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. (继承自 Principal) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| GetUnderlyingObject() |
返回基础 DirectoryEntry 对象,其将提供主体对象的联系人数据。Returns the underlying DirectoryEntry object that provides the contact data for the principal object. (继承自 Principal) |
| GetUnderlyingObjectType() |
返回基础对象类型。Returns the underlying object type. (继承自 Principal) |
| IsAccountLockedOut() |
返回一个布尔值,该值指定帐户当前是否处于锁定状态。Returns a Boolean value that specifies whether the account is currently locked out. (继承自 AuthenticablePrincipal) |
| IsMemberOf(GroupPrincipal) |
返回一个布尔值,该值指定该主体是否是指定组的成员。Returns a Boolean value that specifies whether the principal is a member of the specified group. (继承自 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. (继承自 Principal) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| RefreshExpiredPassword() |
刷新过期的密码。Refreshes an expired password. (继承自 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. (继承自 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. (继承自 Principal) |
| SetPassword(String) |
将帐户密码设置为指定的值。Sets the account password to the specified value. (继承自 AuthenticablePrincipal) |
| ToString() |
返回当前主体对象的用户友好字符串表示形式。Returns a user friendly string representation of the current principal object. (继承自 Principal) |
| UnlockAccount() |
如果当前帐户已锁定,则解锁该帐户。Unlocks the account if it is currently locked out. (继承自 AuthenticablePrincipal) |