How the Active Directory schema is organized
Every attribute and object class in Active Directory is itself an object in the schema partition. Understanding attributeSchema, classSchema, OIDs and syntaxes makes the whole directory readable.
Active Directory is self-describing: the rules for what an object can be are
stored in the directory itself, in the schema partition
(CN=Schema,CN=Configuration,DC=...). Two object classes define everything.
attributeSchema and classSchema
attributeSchemaobjects define attributes. Each one fixes the attribute'slDAPDisplayName(e.g.sAMAccountName), itsattributeID(an OID), itsattributeSyntax(the data type), whether it is single- or multi-valued (isSingleValued), and how it is indexed (searchFlags).classSchemaobjects define object classes (user, group, computer). They list which attributes an object of that class must have (mustContain) and may have (mayContain), and which class they inherit from (subClassOf).
OIDs and syntaxes
Every attribute and class has a globally unique object identifier (OID) —
sAMAccountName is 1.2.840.113556.1.4.221. The 1.2.840.113556 arc is
Microsoft's. The syntax says what the value looks like: a Unicode string,
an integer, a SID, a distinguished name, a generalized time, and so on.
Why it's worth knowing
Because the schema is just more directory objects, you can query it like anything else — to discover which object classes use an attribute, or which attributes are indexed and therefore cheap to filter on. Browse the attribute reference to see individual attributes in context.