Active Directory schema

What is Active Directory Schema?

  • The schema is like the master blueprint or dictionary for the entire Active Directory (AD) database.
  • It defines object classes — these are templates or categories of objects that can exist in AD. Examples include User, Computer, Group, Organizational Unit (OU), Printer, etc.
  • Each object class has a set of attributes — these are pieces of data that describe the object. For example, a User object may have attributes like FirstName, LastName, EmailAddress, and EmployeeID.
  • The schema also defines attribute syntax (data types), constraints, and relationships.

Key Components of the Schema

  1. Object Classes
    • Define the types of objects you can create in AD.
    • Object classes can inherit from other classes (inheritance), allowing reuse of common attributes.
    • Examples: person, organizationalUnit, user.
  2. Attributes
    • Define specific data fields associated with an object class.
    • Attributes have types, like string, integer, Boolean, or binary.
    • Examples: cn (common name), mail (email), member Of (group memberships).
  3. Syntax
    • Determines the format or type of data stored in each attribute, such as Unicode string, Boolean, or integer.
  4. Rules and Constraints
    • Define whether attributes are mandatory or optional for an object class.
    • Define range limits and uniqueness.

Why is the Schema Important?

  • Consistency: It ensures that all objects of a certain class have the same structure and attributes, maintaining data integrity.
  • Extensibility: You can extend the schema to add new object classes or attributes for custom applications.
  • Security: Only schema administrators can modify the schema, protecting the directory from accidental or malicious changes.
  • Interoperability: Many applications and services rely on the schema to understand and query directory data properly.

Schema Management and Extension

  • Schema Master Role: Only one domain controller holds the Schema Master FSMO (Flexible Single Master Operation) role, which controls schema changes.
  • Schema Extensions:
    • You can extend the schema by adding new classes or attributes, usually to support new applications or features (e.g., Exchange, Lync).
    • These changes are replicated to all domain controllers across the forest.
    • Modifying the schema is a critical operation and should be planned carefully because bad changes can break AD functionality.

Example Use Case of Schema Extension

Imagine you want to add an attribute EmployeeBadgeNumber to the User object to store badge numbers for physical access control. You would:

  1. Define a new attribute EmployeeBadgeNumber with its syntax.
  2. Add this attribute to the user object class or a derived class.
  3. Update the schema by importing this change.
  4. After replication, all domain controllers recognize the new attribute.

Summary

Aspect Description
What it defines Object classes and their attributes
Purpose Provide a consistent data model for AD
Modifiable by Schema Admins (highly privileged)
Risks Incorrect changes can cause directory failures
Extensions Possible but must be done carefully