Directory Services |
The property methods of the IADsUser interface get or set the properties described in the following table. For more information, see Interface Property Methods.
Property | Description |
---|---|
AccountDisabled
[Visual Basic] [C++] |
A flag to indicate if the account is or should be disabled. |
AccountExpirationDate
[Visual Basic] [C++] |
The date and time after which the user cannot log on. |
BadLoginAddress
[Visual Basic] [C++] |
The last node that is considered a possible intruder (available if Intruder detection is active). |
BadLoginCount
[Visual Basic] [C++] |
The number of bad logon attempts since the last reset. |
Department
[Visual Basic] [C++] |
The department, an organizational unit (OU), within the company to which the user belongs. |
Description
[Visual Basic] [C++] |
The text description of the user. |
Division
[Visual Basic] [C++] |
The division within a company or organization. |
EmailAddress
[Visual Basic] [C++] |
The e-mail address of the user. |
EmployeeID
[Visual Basic] [C++] |
The employee identifier of the user. |
FaxNumber
[Visual Basic] [C++] |
The fax number, or numbers, of the user. In Active Directory, this property is single-valued and the VARIANT array has one element. |
FirstName
[Visual Basic] [C++] |
The first name of the user. |
FullName
[Visual Basic] [C++] |
The full name of the user. |
GraceLoginsAllowed
[Visual Basic] [C++] |
The number of times the user can log on after the password has expired. |
GraceLoginsRemaining
[Visual Basic] [C++] |
The number of grace logons left before the account is locked. |
HomeDirectory
[Visual Basic] [C++] |
The home directory of the user. |
HomePage
[Visual Basic] [C++] |
The Uniform Resource Locator (URL) for the home page of the user. |
IsAccountLocked
[Visual Basic] [C++] |
A flag that indicates if the account is locked because of intruder detection. For more information and an example that uses this property, see Account Lockout. |
Languages
[Visual Basic] [C++] |
An array of BSTR language names for the user. |
LastFailedLogin
[Visual Basic] [C++] |
The date and time of the last failed network login. |
LastLogin
[Visual Basic] [C++] |
The date and time of the last network login. |
LastLogoff
[Visual Basic] [C++] |
The date and time of the last network logoff. |
LastName
[Visual Basic] [C++] |
The last name of the user. |
LoginHours
[Visual Basic] [C++] |
Time periods for each day of the week during which logons are permitted for the user. Represented as a table of Boolean values for the week, each indicating if that time slot is a valid logon time. Be aware that the representation is provider and directory specific. |
LoginScript
[Visual Basic] [C++] |
The logon script path. |
LoginWorkstations
[Visual Basic] [C++] |
Addresses or names of workstations, of the BSTR data type, from which the user can log on. |
Manager
[Visual Basic] [C++] |
The manager of the user. |
MaxLogins
[Visual Basic] [C++] |
The number of simultaneous login sessions allowed. |
MaxStorage
[Visual Basic] [C++] |
The maximum amount of disk space, in kilobytes, that the user can have. |
NamePrefix
[Visual Basic] [C++] |
Name prefix of the user, for example "Ms.", or "Hon." |
NameSuffix
[Visual Basic] [C++] |
Name suffix of the user, for example "Jr.", or "III". |
OfficeLocations
[Visual Basic] [C++] |
Office location as a BSTR array for the user. For Active Directory, this property is single-valued and the array has one element. |
OtherName
[Visual Basic] [C++] |
An additional name, for example, the middle name, for the user. |
PasswordExpirationDate
[Visual Basic] [C++] |
The date and time when the password expires. |
PasswordLastChanged
[Visual Basic] [C++] |
The last time the password was changed. |
PasswordMinimumLength
[Visual Basic] [C++] |
The minimum length of the password. |
PasswordRequired
[Visual Basic] [C++] |
A flag that indicates if the password is required. |
Picture
[Visual Basic] [C++] |
An OctetString array of bytes that hold an image. |
PostalAddresses
[Visual Basic] [C++] |
Postal address as a BSTR array. This property is multi-valued to hold more than addresses of the user. The internal format of a PostalAddress should comply with CCITT F.401 as referenced in X.521-1993, which defines a PostalAddress as six elements of 30 bytes each, holding a street address, (optionally) Post Office Box, city or locality, state or province, Postal Code, and Country/region. |
PostalCodes
[Visual Basic] [C++] |
Postal codes as a BSTR array. Postal codes are positionally linked to the PostalAddresses array. In Active Directory, however, this property is single-valued and the array has a single element. |
Profile
[Visual Basic] [C++] |
The path to the user profile. |
RequireUniquePassword
[Visual Basic] [C++] |
A flag that indicates if a new password should be different from those known through a password history. |
SeeAlso
[Visual Basic] [C++] |
An array of ADsPaths of other objects related to the user. |
TelephoneHome
[Visual Basic] [C++] |
An array of home telephone numbers of the user. In Active Directory, this property is single-valued and the array has one element. |
TelephoneMobile
[Visual Basic] [C++] |
An array of mobile telephone numbers of the user. In Active Directory this property is single-valued and the array has one element only. |
TelephoneNumber
[Visual Basic] [C++] |
An array of, usually work-related, telephone numbers associated with the user. In Active Directory this property is single-valued and the array is of a single element. |
TelephonePager
[Visual Basic] [C++] |
An array of pager numbers of the user. In Active Directory this property is single-valued and the array is of a single element. |
Title
[Visual Basic] [C++] |
The title of the user. |
The WinNT provider supplied by Microsoft does not support all the IADsUser property methods as presented above. However, the provider supports other properties that can be accessed using the IADs::Get or IADs::Put method. For more information and a list of unsupported properties and code examples, see WinNT User Object in ADSI WinNT Provider.
For more information about ADSI LDAP provider specific features of the user class object, see LDAP User Object in ADSI LDAP Provider. The topic includes IADsUser, as well as code examples for managing a user account.
The following code example shows how to bind to a user account object and retrieve the full name of the user.
Dim usr As IADsUser Dim sFullName as String On Error GoTo Cleanup Set usr = GetObject("WinNT://Fabrikam/JeffSmith,user") sFullName = usr.FullName Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set usr = Nothing
The following code example shows how to bind to a user account object and retrieve the full name of the user.
IADsUser *GetUserObject(LPWSTR uPath) { IADsUser *pUser; HRESULT hr = ADsGetObject(uPath,IID_IADsUser,(void**)&pUser); if (FAILED(hr)) {return NULL;} BSTR bstr; hr = pUser->get_FullName(&bstr); printf("User: %S\n", bstr); SysFreeString(bstr); return pUser; }
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.
IADsUser, Interface Property Methods, IADs::Get, IADs::Put, WinNT User Object, ADSI WinNT Provider, LDAP User Object, ADSI LDAP Provider