Browse docs

Common Active Directory attributes

A reference table of the AD attributes you'll actually use, grouped by purpose.

On this page

A quick reference for the attributes that come up most often when working with Active Directory from application code.

Identity
AttributeTypeNotes
sAMAccountNameStringLegacy short logon name, unique per domain
userPrincipalNameStringEmail-shaped logon name
distinguishedNameStringFull DN of the entry
objectGUIDBinaryPermanent unique identifier — use this as a stable foreign key
objectSidBinarySecurity identifier, used in access tokens
cnStringCommon name / display name, part of the RDN
Personal info
AttributeTypeNotes
givenNameStringFirst name
snStringSurname
mailStringPrimary email address
telephoneNumberStringPhone number
titleStringJob title
departmentStringDepartment name
Group membership
AttributeTypeNotes
memberOfMulti-valued DNGroups this object belongs to (computed, includes nested membership)
memberMulti-valued DNOn a group entry: its direct members
Account status
AttributeTypeNotes
userAccountControlInteger bitmaskEncodes enabled/disabled, password-never-expires, and more
pwdLastSetLarge integerWindows FILETIME (100-ns intervals since 1601); 0 means "must change at next logon"
accountExpiresLarge integerWindows FILETIME, or 0/max value for "never expires"
lockoutTimeLarge integerNon-zero when the account is currently locked out

Note

userAccountControl is a bitmask, not a single flag — the most commonly checked bit is 0x2 (ACCOUNTDISABLE). Rather than parsing this by hand, many applications instead rely on the bind operation itself failing with a decodable status; see Authentication in Active Directory.

Timestamps

Active Directory timestamps come in two different formats, which is a frequent source of bugs:

  • Windows FILETIME (pwdLastSet, accountExpires, lastLogonTimestamp): 100-nanosecond intervals since January 1, 1601 UTC, as a large integer.
  • Generalized Time (whenCreated, whenChanged): a human-readable string like 20240115120000.0Z.

Always check which format a given attribute uses before treating it as a date — assuming one when the attribute actually uses the other silently produces wildly wrong dates.

What's next

Continue to Authentication to see how account status attributes like these surface as bind errors in practice.