IADsUser Property Methods
The property methods of the IADsUser interface get or set the properties described in the following table. For more information, see Interface Property Methods.
Properties
-
AccountDisabled
-
-
Access type: Read/write
-
Scripting data type: Boolean
-
// C++ method syntax HRESULT get_AccountDisabled( [out] VARIANT_BOOL* pfAccountDisabled ); HRESULT put_AccountDisabled( [in] VARIANT_BOOL fAccountDisabled );
A flag to indicate if the account is, or should be, disabled.
-
-
AccountExpirationDate
-
-
Access type: Read/write
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_AccountExpirationDate( [out] DATE* pdateAccountExpirationDate ); HRESULT put_AccountExpirationDate( [in] DATE dateAccountExpirationDate );
The date and time after which the user cannot log on.
-
-
BadLoginAddress
-
-
Access type: Read-only
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_BadLoginAddress( [out] BSTR* pbstrBadLoginAddress );
The last node that is considered a possible intruder; this is available if Intruder detection is active.
-
-
BadLoginCount
-
-
Access type: Read-only
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_BadLoginCount( [out] LONG* plBadLoginCount );
The number of bad logon attempts since the last reset.
-
-
Department
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Department( [out] BSTR* pbstrDepartment ); HRESULT put_Department( [in] BSTR bstrDepartment );
The department, an organizational unit (OU), within the company to which the user belongs.
-
-
Description
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Description( [out] BSTR* pbstrDescription ); HRESULT put_Description( [in] BSTR bstrDescription );
The text description of the user.
-
-
Division
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Division( [out] BSTR* pbstrDivision ); HRESULT put_Division( [in] BSTR bstrDivision );
The division within a company or organization.
-
-
EmailAddress
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_EmailAddress( [out] BSTR* pbstrEmailAddress ); HRESULT put_EmailAddress( [in] BSTR bstrEmailAddress );
The email address of the user.
-
-
EmployeeID
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_EmployeeID( [out] BSTR* pbstrEmployeeID ); HRESULT put_EmployeeID( [in] BSTR bstrEmployeeID );
The employee identifier of the user.
-
-
FaxNumber
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_FaxNumber( [out] VARIANT* pvarFaxNumber ); HRESULT put_FaxNumber( [in] VARIANT varFaxNumber );
The fax number, or numbers, of the user. In Active Directory, this property is single-valued and the VARIANT array has one element.
-
-
FirstName
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_FirstName( [out] BSTR* pbstrFirstName ); HRESULT put_FirstName( [in] BSTR bstrFirstName );
The first name of the user.
-
-
FullName
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_FullName( [out] BSTR* pbstrFullName ); HRESULT put_FullName( [in] BSTR bstrFullName );
The full name of the user.
-
-
GraceLoginsAllowed
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_GraceLoginsAllowed( [out] LONG* plGraceLoginsAllowed ); HRESULT put_GraceLoginsAllowed( [in] LONG lGraceLoginsAllowed );
The number of times the user can log on after the password has expired.
-
-
GraceLoginsRemaining
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_GraceLoginsRemaining( [out] LONG* plGraceLoginsRemaining ); HRESULT put_GraceLoginsRemaining( [in] LONG lGraceLoginsRemaining );
The number of logons allowed before the account is locked.
-
-
HomeDirectory
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_HomeDirectory( [out] BSTR* pbstrHomeDirectory ); HRESULT put_HomeDirectory( [in] BSTR bstrHomeDirectory );
The home directory of the user.
-
-
HomePage
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_HomePage( [out] BSTR* pbstrHomePage ); HRESULT put_HomePage( [in] BSTR bstrHomePage );
The URL for the home page of the user.
-
-
IsAccountLocked
-
-
Access type: Read/write
-
Scripting data type: Boolean
-
// C++ method syntax HRESULT get_IsAccountLocked( [out] VARIANT_BOOL* pfIsAccountLocked ); HRESULT put_IsAccountLocked( [in] VARIANT_BOOL fIsAccountLocked );
A flag that indicates if the account is locked because of intruder detection. This property has limited usage when used with the LDAP ADSI provider. For more information about these limitations, see Account Lockout (LDAP Provider).
-
-
Languages
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_Languages( [out] VARIANT* pvLanguages ); HRESULT put_Languages( [in] VARIANT vLanguages );
An array of BSTR language names for the user.
-
-
LastFailedLogin
-
-
Access type: Read-only
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_LastFailedLogin( [out] DATE* pdateLastFailedLogin );
The date and time of the last failed network login.
-
-
LastLogin
-
-
Access type: Read-only
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_LastLogin( [out] DATE* pdateLastLogin );
The date and time of the last network login.
-
-
LastLogoff
-
-
Access type: Read-only
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_LastLogoff( [out] DATE* pdateLastLogoff );
The date and time of the last network logoff.
-
-
LastName
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_LastName( [out] BSTR* pbstrLastName ); HRESULT put_LastName( [in] BSTR bstrLastName );
The last name of the user.
-
-
LoginHours
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_LoginHours( [out] VARIANT* pvLoginHours ); HRESULT put_LoginHours( [in] VARIANT vLoginHours );
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
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_LoginScript( [out] BSTR* pbstrLoginScript ); HRESULT put_LoginScript( [in] BSTR bstrLoginScript );
The logon script path.
-
-
LoginWorkstations
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_LoginWorkstations( [out] VARIANT* pvLoginWorkstations ); HRESULT put_LoginWorkstations( [in] VARIANT vLoginWorkstations );
Addresses or names of workstations, of the BSTR data type, from which the user can log on.
-
-
Manager
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Manager( [out] BSTR* pbstrManager ); HRESULT put_Manager( [in] BSTR bstrManager );
The manager of the user.
-
-
MaxLogins
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_MaxLogins( [out] LONG* plMaxLogins ); HRESULT put_MaxLogins( [in] LONG lMaxLogins );
The number of simultaneous login sessions allowed.
-
-
MaxStorage
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_MaxStorage( [out] LONG* plMaxStorage ); HRESULT put_MaxStorage( [in] LONG lMaxStorage );
The maximum amount of disk space, in kilobytes, that the user can use.
-
-
NamePrefix
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_NamePrefix( [out] BSTR* pbstrNamePrefix ); HRESULT put_NamePrefix( [in] BSTR bstrNamePrefix );
Name prefix of the user, for example "Ms.", or "Hon."
-
-
NameSuffix
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_NameSuffix( [out] BSTR* pbstrNameSuffix ); HRESULT put_NameSuffix( [in] BSTR bstrNameSuffix );
Name suffix of the user, for example "Jr.", or "III".
-
-
OfficeLocations
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_OfficeLocations( [out] VARIANT* pvOfficeLocations ); HRESULT put_OfficeLocations( [in] VARIANT vOfficeLocations );
Office location as a BSTR array for the user. For Active Directory, this property is single-valued and the array has one element.
-
-
OtherName
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_OtherName( [out] BSTR* pbstrOtherName ); HRESULT put_OtherName( [in] BSTR bstrOtherName );
An additional name, for example, the middle name, for the user.
-
-
PasswordExpirationDate
-
-
Access type: Read/write
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_PasswordExpirationDate( [out] DATE* pdatePasswordExpirationDate ); HRESULT put_PasswordExpirationDate( [in] DATE datePasswordExpirationDate );
The date and time when the password expires.
-
-
PasswordLastChanged
-
-
Access type: Read-only
-
Scripting data type: DATE
-
// C++ method syntax HRESULT get_PasswordLastChanged( [out] DATE* pdatePasswordLastChanged );
The last time the password was changed.
-
-
PasswordMinimumLength
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_PasswordMinimumLength( [out] LONG* plPasswordMinimumLength ); HRESULT put_PasswordMinimumLength( [in] LONG lPasswordMinimumLength );
The minimum length of the password.
-
-
PasswordRequired
-
-
Access type: Read/write
-
Scripting data type: Boolean
-
// C++ method syntax VARIANT_BOOL get_PasswordRequired( [out] VARIANT_BOOL* pfPasswordRequired ); HRESULT put_PasswordRequired( [in] VARIANT_BOOL fPasswordRequired );
A flag that indicates if the password is required.
-
-
Picture
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_Picture( [out] VARIANT* pvarPicture ); HRESULT put_Picture( [in] VARIANT varPicture );
An OctetString array of bytes that store an image.
-
-
PostalAddresses
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_PostalAddresses( [out] VARIANT* pvPostalAddresses ); HRESULT put_PostalAddresses( [in] VARIANT vPostalAddresses );
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
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_PostalCodes( [out] VARIANT* pvPostalCodes ); HRESULT put_PostalCodes( [in] VARIANT vPostalCodes );
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
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Profile( [out] BSTR* pbstrProfile ); HRESULT put_Profile( [in] BSTR bstrProfile );
The path to the user profile.
-
-
RequireUniquePassword
-
-
Access type: Read/write
-
Scripting data type: Boolean
-
// C++ method syntax HRESULT get_RequireUniquePassword( [out] VARIANT_BOOL* pfRequireUniquePassword ); HRESULT put_RequireUniquePassword( [in] VARIANT_BOOL fRequireUniquePassword );
A flag that indicates if a new password should be different from those known through a password history.
-
-
SeeAlso
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_SeeAlso( [out] VARIANT* pvSeeAlso ); HRESULT put_SeeAlso( [in] VARIANT vSeeAlso );
An array of ADsPaths of other objects related to the user.
-
-
TelephoneHome
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_TelephoneHome( [out] VARIANT* pvarTelephoneHome ); HRESULT put_TelephoneHome( [in] VARIANT varTelephoneHome );
An array of home phone numbers of the user. In Active Directory, this property is single-valued and the array has one element.
-
-
TelephoneMobile
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_TelephoneMobile( [out] VARIANT* pvarTelephoneMobile ); HRESULT put_TelephoneMobile( [in] VARIANT varTelephoneMobile );
An array of mobile phone numbers of the user. In Active Directory this property is single-valued and the array has one element only.
-
-
TelephoneNumber
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_TelephoneNumber( [out] VARIANT* pvarTelephoneNumber ); HRESULT put_TelephoneNumber( [in] VARIANT varTelephoneNumber );
An array of, usually work-related, phone numbers associated with the user. In Active Directory this property is single-valued and the array is of a single element.
-
-
TelephonePager
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_TelephonePager( [out] VARIANT* pvarTelephonePager ); HRESULT put_TelephonePager( [in] VARIANT varTelephonePager );
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
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Title( [out] BSTR* pbstrTitle ); HRESULT put_Title( [in] BSTR bstrTitle );
The title of the user.
-
Remarks
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.
Examples
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;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
|
DLL |
|
IID |
IID_IADsUser is defined as 3E37E320-17E2-11CF-ABC4-02608C9E7553 |