Directory Services

ADS_USER_FLAG_ENUM

The ADS_USER_FLAG_ENUM enumeration defines the flags used for setting user properties in the directory. These flags correspond to values of the userAccountControl attribute in Active Directory when using the LDAP provider, and the userFlags attribute when using the WinNT system provider.

typedef enum 
{
  ADS_UF_SCRIPT = 0X0001, 
  ADS_UF_ACCOUNTDISABLE = 0X0002, 
  ADS_UF_HOMEDIR_REQUIRED = 0X0008, 
  ADS_UF_LOCKOUT = 0X0010, 
  ADS_UF_PASSWD_NOTREQD = 0X0020, 
  ADS_UF_PASSWD_CANT_CHANGE = 0X0040, 
  ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = 0X0080, 
  ADS_UF_TEMP_DUPLICATE_ACCOUNT = 0X0100, 
  ADS_UF_NORMAL_ACCOUNT = 0X0200, 
  ADS_UF_INTERDOMAIN_TRUST_ACCOUNT = 0X0800, 
  ADS_UF_WORKSTATION_TRUST_ACCOUNT = 0X1000, 
  ADS_UF_SERVER_TRUST_ACCOUNT = 0X2000, 
  ADS_UF_DONT_EXPIRE_PASSWD = 0X10000, 
  ADS_UF_MNS_LOGON_ACCOUNT = 0X20000, 
  ADS_UF_SMARTCARD_REQUIRED = 0X40000, 
  ADS_UF_TRUSTED_FOR_DELEGATION = 0X80000, 
  ADS_UF_NOT_DELEGATED = 0X100000, 
  ADS_UF_USE_DES_KEY_ONLY = 0x200000, 
  ADS_UF_DONT_REQUIRE_PREAUTH = 0x400000, 
  ADS_UF_PASSWORD_EXPIRED = 0x800000, 
  ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 0x1000000
} ADS_USER_FLAG_ENUM;

Values

ADS_UF_SCRIPT
The logon script is executed. This flag does not work for the ADSI LDAP provider on either read or write operations. For the ADSI WinNT provider, this flag is read only data, and it cannot be set on user objects.
ADS_UF_ACCOUNTDISABLE
The user account is disabled.
ADS_UF_HOMEDIR_REQUIRED
The home directory is required.
ADS_UF_LOCKOUT
The account is currently locked out.
ADS_UF_PASSWD_NOTREQD
No password is required.
ADS_UF_PASSWD_CANT_CHANGE
The user cannot change the password. You can read this flag, but you cannot set it directly. For more information, and a code example that shows how to prevent a user from changing the password, see User Cannot Change Password.
ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED
The user can send an encrypted password.
ADS_UF_TEMP_DUPLICATE_ACCOUNT
This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. Also known as a local user account.
ADS_UF_NORMAL_ACCOUNT
This is a default account type that represents a typical user.
ADS_UF_INTERDOMAIN_TRUST_ACCOUNT
This is a permit to trust account for a system domain that trusts other domains.
ADS_UF_WORKSTATION_TRUST_ACCOUNT
This is a computer account for a Microsoft® Windows® NT Workstation/Windows 2000 Professional or Windows NT® Server/Windows 2000 Server that is a member of this domain.
ADS_UF_SERVER_TRUST_ACCOUNT
This is a computer account for a system backup domain controller that is a member of this domain.
ADS_UF_DONT_EXPIRE_PASSWD
When set, the password will not expire on this account.
ADS_UF_MNS_LOGON_ACCOUNT
This is an MNS logon account.
ADS_UF_SMARTCARD_REQUIRED
When set, this flag will force the user to log on using a smart card.
ADS_UF_TRUSTED_FOR_DELEGATION
When set, the service account (user or computer account), under which a service runs, is trusted for Kerberos delegation. Any such service can impersonate a client requesting the service. To enable a service for Kerberos delegation, set this flag on the userAccountControl property of the service account.
ADS_UF_NOT_DELEGATED
When set, the security context of the user will not be delegated to a service even if the service account is set as trusted for Kerberos delegation.
ADS_UF_USE_DES_KEY_ONLY
Windows 2000/XP: Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys.
ADS_UF_DONT_REQUIRE_PREAUTH
Windows 2000/XP: This account does not require Kerberos preauthentication for logon.
ADS_UF_PASSWORD_EXPIRED
Windows XP: The user password has expired. UF_PASSWORD_EXPIRED is a bit created by the system, using data from the password last set attribute and the domain policy. It is read-only and cannot be set. To manually set a user password as expired, use USER_INFO_3 for Windows NT/Windows 2000 servers or USER_INFO_4 for Windows XP users.
ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION
Windows 2000/XP: The account is enabled for delegation. This is a security-sensitive setting; accounts with this option enabled should be tightly controlled. This setting enables a service running under the account to assume a client identity and authenticate as that user to other remote servers on the network.

Remarks

For more information, see Managing Users.

For more information, and a code example that shows how to set the ADS_UF_DONT_EXPIRE_PASSWD value on a user userAccountControl attribute, see Password Never Expires.

Note  Because VBScript cannot read data from a type library, VBScript applications do not understand the symbolic constants as defined above. Use the numerical constants, instead, to set the appropriate flags in your VBScript applications. To use the symbolic constants as a good programming practice, create explicit declarations of such constants, as done here, in your VBScript applications.

Requirements

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.

See Also

ADSI Enumerations, Managing Users, NetUserGetInfo