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

A flag to indicate if the account is, or should be, disabled.

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
);

AccountExpirationDate

The date and time after which the user cannot log on.

Access type: Read/write

Scripting data type: DATE

// C++ method syntax
HRESULT get_AccountExpirationDate(
  [out] DATE* pdateAccountExpirationDate
);
HRESULT put_AccountExpirationDate(
  [in] DATE dateAccountExpirationDate
);

BadLoginAddress

The last node that is considered a possible intruder; this is available if Intruder detection is active.

Access type: Read-only

Scripting data type: BSTR

// C++ method syntax
HRESULT get_BadLoginAddress(
  [out] BSTR* pbstrBadLoginAddress
);

BadLoginCount

The number of bad logon attempts since the last reset.

Access type: Read-only

Scripting data type: LONG

// C++ method syntax
HRESULT get_BadLoginCount(
  [out] LONG* plBadLoginCount
);

Department

The department, an organizational unit (OU), within the company to which the user belongs.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Department(
  [out] BSTR* pbstrDepartment
);
HRESULT put_Department(
  [in] BSTR bstrDepartment
);

Description

The text description of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Description(
  [out] BSTR* pbstrDescription
);
HRESULT put_Description(
  [in] BSTR bstrDescription
);

Division

The division within a company or organization.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Division(
  [out] BSTR* pbstrDivision
);
HRESULT put_Division(
  [in] BSTR bstrDivision
);

EmailAddress

The email address of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_EmailAddress(
  [out] BSTR* pbstrEmailAddress
);
HRESULT put_EmailAddress(
  [in] BSTR bstrEmailAddress
);

EmployeeID

The employee identifier of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_EmployeeID(
  [out] BSTR* pbstrEmployeeID
);
HRESULT put_EmployeeID(
  [in] BSTR bstrEmployeeID
);

FaxNumber

The fax number, or numbers, of the user. In Active Directory, this property is single-valued and the VARIANT array has one element.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_FaxNumber(
  [out] VARIANT* pvarFaxNumber
);
HRESULT put_FaxNumber(
  [in] VARIANT varFaxNumber
);

FirstName

The first name of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_FirstName(
  [out] BSTR* pbstrFirstName
);
HRESULT put_FirstName(
  [in] BSTR bstrFirstName
);

FullName

The full name of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_FullName(
  [out] BSTR* pbstrFullName
);
HRESULT put_FullName(
  [in] BSTR bstrFullName
);

GraceLoginsAllowed

The number of times the user can log on after the password has expired.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_GraceLoginsAllowed(
  [out] LONG* plGraceLoginsAllowed
);
HRESULT put_GraceLoginsAllowed(
  [in] LONG lGraceLoginsAllowed
);

GraceLoginsRemaining

The number of logons allowed before the account is locked.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_GraceLoginsRemaining(
  [out] LONG* plGraceLoginsRemaining
);
HRESULT put_GraceLoginsRemaining(
  [in] LONG lGraceLoginsRemaining
);

HomeDirectory

The home directory of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_HomeDirectory(
  [out] BSTR* pbstrHomeDirectory
);
HRESULT put_HomeDirectory(
  [in] BSTR bstrHomeDirectory
);

HomePage

The URL for the home page of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_HomePage(
  [out] BSTR* pbstrHomePage
);
HRESULT put_HomePage(
  [in] BSTR bstrHomePage
);

IsAccountLocked

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).

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
);

Languages

An array of BSTR language names for the user.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_Languages(
  [out] VARIANT* pvLanguages
);
HRESULT put_Languages(
  [in] VARIANT vLanguages
);

LastFailedLogin

The date and time of the last failed network login.

Access type: Read-only

Scripting data type: DATE

// C++ method syntax
HRESULT get_LastFailedLogin(
  [out] DATE* pdateLastFailedLogin
);

LastLogin

The date and time of the last network login.

Access type: Read-only

Scripting data type: DATE

// C++ method syntax
HRESULT get_LastLogin(
  [out] DATE* pdateLastLogin
);

LastLogoff

The date and time of the last network logoff.

Access type: Read-only

Scripting data type: DATE

// C++ method syntax
HRESULT get_LastLogoff(
  [out] DATE* pdateLastLogoff
);

LastName

The last name of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_LastName(
  [out] BSTR* pbstrLastName
);
HRESULT put_LastName(
  [in] BSTR bstrLastName
);

LoginHours

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.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_LoginHours(
  [out] VARIANT* pvLoginHours
);
HRESULT put_LoginHours(
  [in] VARIANT vLoginHours
);

LoginScript

The logon script path.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_LoginScript(
  [out] BSTR* pbstrLoginScript
);
HRESULT put_LoginScript(
  [in] BSTR bstrLoginScript
);

LoginWorkstations

Addresses or names of workstations, of the BSTR data type, from which the user can log on.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_LoginWorkstations(
  [out] VARIANT* pvLoginWorkstations
);
HRESULT put_LoginWorkstations(
  [in] VARIANT vLoginWorkstations
);

Manager

The manager of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Manager(
  [out] BSTR* pbstrManager
);
HRESULT put_Manager(
  [in] BSTR bstrManager
);

MaxLogins

The number of simultaneous login sessions allowed.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_MaxLogins(
  [out] LONG* plMaxLogins
);
HRESULT put_MaxLogins(
  [in] LONG lMaxLogins
);

MaxStorage

The maximum amount of disk space, in kilobytes, that the user can use.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_MaxStorage(
  [out] LONG* plMaxStorage
);
HRESULT put_MaxStorage(
  [in] LONG lMaxStorage
);

NamePrefix

Name prefix of the user, for example "Ms.", or "Hon."

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_NamePrefix(
  [out] BSTR* pbstrNamePrefix
);
HRESULT put_NamePrefix(
  [in] BSTR bstrNamePrefix
);

NameSuffix

Name suffix of the user, for example "Jr.", or "III".

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_NameSuffix(
  [out] BSTR* pbstrNameSuffix
);
HRESULT put_NameSuffix(
  [in] BSTR bstrNameSuffix
);

OfficeLocations

Office location as a BSTR array for the user. For Active Directory, this property is single-valued and the array has one element.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_OfficeLocations(
  [out] VARIANT* pvOfficeLocations
);
HRESULT put_OfficeLocations(
  [in] VARIANT vOfficeLocations
);

OtherName

An additional name, for example, the middle name, for the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_OtherName(
  [out] BSTR* pbstrOtherName
);
HRESULT put_OtherName(
  [in] BSTR bstrOtherName
);

PasswordExpirationDate

The date and time when the password expires.

Access type: Read/write

Scripting data type: DATE

// C++ method syntax
HRESULT get_PasswordExpirationDate(
  [out] DATE* pdatePasswordExpirationDate
);
HRESULT put_PasswordExpirationDate(
  [in] DATE datePasswordExpirationDate
);

PasswordLastChanged

The last time the password was changed.

Access type: Read-only

Scripting data type: DATE

// C++ method syntax
HRESULT get_PasswordLastChanged(
  [out] DATE* pdatePasswordLastChanged
);

PasswordMinimumLength

The minimum length of the password.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_PasswordMinimumLength(
  [out] LONG* plPasswordMinimumLength
);
HRESULT put_PasswordMinimumLength(
  [in] LONG lPasswordMinimumLength
);

PasswordRequired

A flag that indicates if the password is required.

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
);

Picture

An OctetString array of bytes that store an image.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_Picture(
  [out] VARIANT* pvarPicture
);
HRESULT put_Picture(
  [in] VARIANT varPicture
);

PostalAddresses

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.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_PostalAddresses(
  [out] VARIANT* pvPostalAddresses
);
HRESULT put_PostalAddresses(
  [in] VARIANT vPostalAddresses
);

PostalCodes

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.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_PostalCodes(
  [out] VARIANT* pvPostalCodes
);
HRESULT put_PostalCodes(
  [in] VARIANT vPostalCodes
);

Profile

The path to the user profile.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Profile(
  [out] BSTR* pbstrProfile
);
HRESULT put_Profile(
  [in] BSTR bstrProfile
);

RequireUniquePassword

A flag that indicates if a new password should be different from those known through a password history.

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
);

SeeAlso

An array of ADsPaths of other objects related to the user.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_SeeAlso(
  [out] VARIANT* pvSeeAlso
);
HRESULT put_SeeAlso(
  [in] VARIANT vSeeAlso
);

TelephoneHome

An array of home phone numbers of the user. In Active Directory, this property is single-valued and the array has one element.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_TelephoneHome(
  [out] VARIANT* pvarTelephoneHome
);
HRESULT put_TelephoneHome(
  [in] VARIANT varTelephoneHome
);

TelephoneMobile

An array of mobile phone numbers of the user. In Active Directory this property is single-valued and the array has one element only.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_TelephoneMobile(
  [out] VARIANT* pvarTelephoneMobile
);
HRESULT put_TelephoneMobile(
  [in] VARIANT varTelephoneMobile
);

TelephoneNumber

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.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_TelephoneNumber(
  [out] VARIANT* pvarTelephoneNumber
);
HRESULT put_TelephoneNumber(
  [in] VARIANT varTelephoneNumber
);

TelephonePager

An array of pager numbers of the user. In Active Directory this property is single-valued and the array is of a single element.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_TelephonePager(
  [out] VARIANT* pvarTelephonePager
);
HRESULT put_TelephonePager(
  [in] VARIANT varTelephonePager
);

Title

The title of the user.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Title(
  [out] BSTR* pbstrTitle
);
HRESULT put_Title(
  [in] BSTR bstrTitle
);

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
Iads.h
DLL
Activeds.dll
IID
IID_IADsUser is defined as 3E37E320-17E2-11CF-ABC4-02608C9E7553

See also

IADsUser

Interface Property Methods

IADs::Get

IADs::Put

WinNT User Object

ADSI WinNT Provider

LDAP User Object

ADSI LDAP Provider