userAccountControl decoder
Every user and computer account in Active Directory has a userAccountControl value: the flags of the account, added up into one number. Enter the number to see its flags, or tick flags in the table to build a value.
Common values
Most accounts have one of these values. Microsoft gives 512 for a typical user, 4096 for a workstation or member server, 532480 for a domain controller and 2080 for a trust. Select a value to decode it above.
| Decimal | Hex | Flags | What it usually is |
|---|---|---|---|
| 512 | 0x200 | NORMAL_ACCOUNT | An enabled user. Microsoft gives 512 as the value of a typical user. |
| 514 | 0x202 | ACCOUNTDISABLE + NORMAL_ACCOUNT | A disabled user. |
| 544 | 0x220 | PASSWD_NOTREQD + NORMAL_ACCOUNT | An enabled user that may have an empty password. |
| 546 | 0x222 | ACCOUNTDISABLE + PASSWD_NOTREQD + NORMAL_ACCOUNT | A disabled user that may have an empty password. |
| 66048 | 0x10200 | NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD | An enabled user whose password never expires, often a service account. |
| 66050 | 0x10202 | ACCOUNTDISABLE + NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD | A disabled user whose password never expires. |
| 66080 | 0x10220 | PASSWD_NOTREQD + NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD | An enabled user whose password never expires and may be empty. |
| 66082 | 0x10222 | ACCOUNTDISABLE + PASSWD_NOTREQD + NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD | A disabled user whose password never expires and may be empty. |
| 262656 | 0x40200 | NORMAL_ACCOUNT + SMARTCARD_REQUIRED | A user who must log on with a smart card. |
| 4194816 | 0x400200 | NORMAL_ACCOUNT + DONT_REQ_PREAUTH | A user without Kerberos pre-authentication, open to AS-REP roasting. |
| 590336 | 0x90200 | NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD + TRUSTED_FOR_DELEGATION | A user trusted for unconstrained delegation whose password never expires. |
| 8389120 | 0x800200 | NORMAL_ACCOUNT + PASSWORD_EXPIRED | A user whose password has expired, as msDS-User-Account-Control-Computed shows it. |
| 4096 | 0x1000 | WORKSTATION_TRUST_ACCOUNT | A workstation or member server. Microsoft gives 4096 for both. |
| 4098 | 0x1002 | ACCOUNTDISABLE + WORKSTATION_TRUST_ACCOUNT | A disabled computer account. |
| 4128 | 0x1020 | PASSWD_NOTREQD + WORKSTATION_TRUST_ACCOUNT | A computer account that may have an empty password. Computer accounts created in advance in Active Directory Users and Computers start with this value. |
| 532480 | 0x82000 | SERVER_TRUST_ACCOUNT + TRUSTED_FOR_DELEGATION | A domain controller. Microsoft gives 532480 as the domain controller value. |
| 83890176 | 0x5001000 | WORKSTATION_TRUST_ACCOUNT + TRUSTED_TO_AUTH_FOR_DELEGATION + PARTIAL_SECRETS_ACCOUNT | A read-only domain controller (RODC). |
| 2080 | 0x820 | PASSWD_NOTREQD + INTERDOMAIN_TRUST_ACCOUNT | A trust account. Microsoft gives 2080 for trusts: PASSWD_NOTREQD is normal here, because trust passwords are kept elsewhere. |
All flags
Tick a flag to add it to the value above. Two of the flags, LOCKOUT and PASSWORD_EXPIRED, have not been kept in userAccountControl since Windows Server 2003: Windows works them out each time and shows them in msDS-User-Account-Control-Computed. PASSWD_CANT_CHANGE is not kept here either, because User cannot change password is a permission on the account.
| Tick | Flag | Hex | Decimal | What it means |
|---|---|---|---|---|
0x00000001 | 1 | The logon script runs. | ||
0x00000002 | 2 | The account is disabled: nobody can log on with it. | ||
0x00000008 | 8 | A home folder is required. | ||
0x00000010 | 16 | The account is locked out. Windows does not keep this flag up to date in userAccountControl: read msDS-User-Account-Control-Computed or lockoutTime instead. | ||
0x00000020 | 32 | No password is required: the password length policy does not apply, so the password can be empty. | ||
0x00000040 | 64 | The user cannot change the password. Windows does not keep this here: the option is a permission on the account, and setting the bit has no effect. | ||
0x00000080 | 128 | Store password using reversible encryption: the password is kept in a form that can be turned back into clear text. | ||
0x00000100 | 256 | An account for a user whose main account is in another domain. | ||
0x00000200 | 512 | A typical user account. | ||
0x00000800 | 2048 | The account of a trust with another domain. | ||
0x00001000 | 4096 | The computer account of a workstation or member server of this domain. | ||
0x00002000 | 8192 | The computer account of a domain controller of this domain. | ||
0x00010000 | 65536 | The password never expires. | ||
0x00020000 | 131072 | An MNS logon account. | ||
0x00040000 | 262144 | The user must log on with a smart card. | ||
0x00080000 | 524288 | Trusted for delegation to any service (unconstrained delegation): its tickets carry the OK as Delegate flag. Normal on domain controllers. | ||
0x00100000 | 1048576 | Account is sensitive and cannot be delegated: its tickets are not forwardable, so no service can act as this account. | ||
0x00200000 | 2097152 | Kerberos uses only DES keys for this account. | ||
0x00400000 | 4194304 | Kerberos pre-authentication is not required. | ||
0x00800000 | 8388608 | The password is older than the maximum password age. Not kept here: Windows shows it in msDS-User-Account-Control-Computed. | ||
0x01000000 | 16777216 | Trusted to authenticate for delegation: a service running as this account gets forwardable tickets for users who did not log on with Kerberos (protocol transition). Normal on read-only domain controllers. | ||
0x02000000 | 33554432 | Service tickets for this account carry no PAC, the part that lists the user's groups. | ||
0x04000000 | 67108864 | The computer account of a read-only domain controller (RODC). WORKSTATION_TRUST_ACCOUNT is always set with it. | ||
0x08000000 | 134217728 | Defined in lmaccess.h, but Windows clients and servers ignore it. |
Find and change accounts with PowerShell
Get-ADUser jdoe -Properties userAccountControl, msDS-User-Account-Control-Computed
Get-ADUser -LDAPFilter "(userAccountControl:1.2.840.113556.1.4.803:=2)"
Get-ADUser -LDAPFilter "(userAccountControl:1.2.840.113556.1.4.803:=4194304)"
Get-ADComputer -LDAPFilter "(userAccountControl:1.2.840.113556.1.4.803:=524288)"
Set-ADAccountControl jdoe -PasswordNeverExpires $false
Disable-ADAccount jdoe
The second line finds disabled users, the third users without Kerberos pre-authentication, the fourth computers trusted for unconstrained delegation. 1.2.840.113556.1.4.803 is the LDAP rule for a bitwise AND: an account matches when it has every bit of the number. 1.2.840.113556.1.4.804 is the bitwise OR: an account matches when it has any of them.
To change a flag, use a cmdlet that sets one option, such as Set-ADAccountControl with -PasswordNeverExpires, -PasswordNotRequired, -DoesNotRequirePreAuth, -TrustedForDelegation or -AccountNotDelegated, rather than writing the whole number: a number typed by hand can drop a flag the account needs.
Sources
The flags and their values are from Microsoft's documentation: the article Use the UserAccountControl flags to manipulate user account properties, the User-Account-Control and ms-DS-User-Account-Control-Computed attribute pages, section 2.2.16 of the Active Directory Technical Specification [MS-ADTS], and the header file lmaccess.h. Microsoft publishes the article and the attribute pages under the Creative Commons Attribution 4.0 International licence. The descriptions here are this site's own wording.
More Active Directory tools
-
Logon failure decoder
Read failed logon events 4625, 4771 and 4776: Status and Sub Status, Kerberos failure codes and logon types.
-
LDAP error decoder
Read an LDAP error from Active Directory: result code 49 and data 52e, 775, 773 or 532.
-
AD rights GUID lookup
Name the GUIDs in an ACL or event 4662: extended rights, property sets, classes and attributes.
-
groupType and sAMAccountType decoder
Turn -2147483646 or 805306368 into a group scope, a group type or an account type.
-
Kerberos encryption types decoder
Decode msDS-SupportedEncryptionTypes and ticket encryption types, and see where RC4 is still allowed.
-
Active Directory timestamp converter
Convert lastLogonTimestamp, pwdLastSet and other 18-digit values to dates and back.
-
SDDL and SID decoder
Read a security descriptor string in plain words and look up well-known SIDs.
-
GUID and SID converter
Turn an objectGUID or objectSid from base64, bytes or an immutableId into its GUID or S-1-5-21 form and back.
-
LDAP filter builder and explainer
Read an LDAP filter in plain words, with the bitwise and nested-group rules, or build one for common searches.