Platform SDK: Active Directory, ADSI, and Directory Services

IADsDomain Property Methods

The methods of the IADsDomain interface read and write the properties described in this topic. For more information see Interface Property Methods.

Properties in Vtable Order

Property Description
AutoUnlockInterval

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_AutoUnlockInterval
([out] LONG *plAutoUnlockInterval);


HRESULT put_AutoUnlockInterval
([in] LONG lAutoUnlockInterval);

Indicates the minimum time elapsed before the account is automatically re-enabled.
IsWorkgroup

[Visual Basic]
Access: Read
Data Type: VARIANT

[C++]
HRESULT get_IsWorkgroup
([out] VARIANT_BOOL *retval);

Indicates a flag that indicates whether or not the domain is a workstation belonging to a workgroup.
LockoutObservationInterval

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_LockoutObservationInterval
([out] LONG *plLockoutObservationInterval);


HRESULT put_LockoutObservationInterval
([in] LONG lLockoutObservationInterval);

Indicates the time window during which the bad password count is monitored and accumulated before determining if the account needs to be locked out. For example, if the number of bad password attempts on an account exceed the threshold (Maximum Bad Passwords Allowed) during the specified time period (Lockout Observation Interval) the account will be locked out by setting the appropriate property in the Login Parameter property set.
MinPasswordAge

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_MinPasswordAge
([out] LONG *plMinPasswordAge);


HRESULT put_MinPasswordAge
([in] LONG lMinPasswordAge);

Indicates the minimum amount of time, in seconds, before the password is allowed to be changed.
MinPasswordLength

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_MinPasswordLength
(
[out] LONG *plMinPasswordLength);


HRESULT put_MinPasswordLength
([in] LONG lMinPasswordLength);

Indicates the minimum number of characters that must be typed in for a password.
MaxBadPasswordsAllowed

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_MaxBadPasswordsAllowed
([out] LONG *plMaxBadPasswordsAllowed);


HRESULT put_MaxBadPasswordsAllowed
([in] LONG lMaxBadPasswordsAllowed);

Indicates the maximum number of bad password logins until the account becomes locked out.
MaxPasswordAge

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_MaxPasswordAge
([out] LONG *plMaxPasswordAge);


RESULT put_MaxPasswordAge
([in] LONG lMaxPasswordAge);

Indicates the maximum amount of time, in seconds, after which the password must be changed by the owner.
PasswordAttributes

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_PasswordAttributes
([out] LONG *plPasswordAttributes);


HRESULT put_PasswordAttributes
([in] LONG lPasswordAttributes);

Indicates restrictions on passwords, as defined in the following:
  Attribute
PASSWORD_ATTR_NONE
PASSWORD_ATTR_MIXED_CASE
PASSWORD_ATTR_COMPLEX
Value
0x00000000
0x00000001
0x00000002
Note  For PASSWORD_ATTR_COMPLEX, the password must include at least one punctuation mark or non-printable character.
PasswordHistoryLength

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_PasswordHistoryLength
([out] LONG *plPasswordHistoryLength);


HRESULT put_PasswordHistoryLength
([in] LONG lPasswordHistoryLength);

Indicates the number of previous passwords saved in the history list. The user cannot reuse a password that is in the history list.

Example Code [Visual Basic]

The following Visual Basic code snippet displays all the optional properties defined for a domain and then change the MinPasswordLength property value.

Dim dom as IADsDomain
Dim cls as IADsClass
Dim v
Set dom = GetObject("WinNT://myDomain")
Set cls = GetObject(dom.Schema)
For Each x in cls.OptionalProperties
    v = dom.Get(x)
    if x = "MinPasswordLength" then
        v = 10
    end if
    debug.print x & " = " & v
Next

Example Code [C++]

The following C++/C code snippet prints out the value of the MinPasswordLength property of a domain object.

LPWSTR adsPath = L"WinNT://myDomain";

// bind to the domain object
hr = ADsGetObject(adsPath,IID_IADsDomain,(void**)&pDomain);
if(FAILED(hr)) return NULL;

printf("Domain:\n");

IADs* pADsDom;
pDomain->QueryInterface(IID_IADs,(void**)&pADsDom);

VARIANT varVal;
VariantInit(&varVal);
pADsDom->Get(L"MinPasswordLength",&varVal);
printf("    MinPasswordLength = %d\n", V_I4(&varVal));

VariantClear(&varVal);
pADsDom->Release();
pDomain->Release();

See Also

IADsDomain, Interface Property Methods