#Why this matters
Standalone Windows hosts keep local SAM accounts and local security policies, which becomes unmanageable across dozens or thousands of machines. Active Directory Domain Services (AD DS) centralizes identity, authentication, and host configuration. Understanding domains, Organizational Units (OUs), and Group Policy Objects (GPOs) is vital for both administrators and defenders, because misconfigured OUs, permissive GPOs, and over-privileged groups are common paths to domain compromise.
#Forests, domains, and Organizational Units
Active Directory stores objects on Domain Controllers (DCs) in the NTDS.dit database and replicates shared policy files through SYSVOL.
| Container | Role | Security Boundary? | Links GPOs? |
|---|---|---|---|
| Forest | Top-level container sharing one schema and Global Catalog | Yes | No |
| Tree | Domains sharing a contiguous DNS namespace | No | No |
| Domain | Partition of users, computers, groups, and OUs (lab.local) |
Administrative only | Yes |
| OU | Sub-container inside a domain (OU=Servers) |
No | Yes |
Every object has a unique Distinguished Name (DN) read from object to root, such as CN=jdoe,OU=Helpdesk,OU=Staff,DC=lab,DC=local.
Do not confuse an OU with a Security Group:
- OUs group objects to link GPOs and delegate administration (such as password resets inside
OU=Workstations). - Security Groups grant access permissions on file shares, printers, and privileged roles. You cannot assign NTFS ACLs to an OU or link a GPO directly to a security group.
#How DNS, Kerberos, and LDAP work together
A domain-joined host uses three core protocols on every logon and policy refresh:
- DNS locates DCs via SRV records like
_ldap._tcp.dc._msdcs.lab.localand_kerberos._tcp.lab.local. - Kerberos (port
88) authenticates users and computers through the KDC on the DC, issuing a TGT and Service Tickets instead of resending passwords. - LDAP (port
389, or636for LDAPS) queries directory attributes and finds GPO links for the computer and user DNs.
#Group Policy Objects and LSDOU precedence
A Group Policy Object (GPO) separates Computer Configuration (applied at startup) from User Configuration (applied at logon). Each GPO spans AD metadata and template files under \\lab.local\SYSVOL\lab.local\Policies\{GUID}.
Conflicting GPO settings resolve in LSDOU order, where the last applied policy wins:
- Local policy
- Site-linked GPOs
- Domain-linked GPOs (
Default Domain Policy) - Organizational Unit-linked GPOs, from parent OU down to child OU
Block Inheritance on an OU stops non-enforced parent GPOs, while Enforced on a parent link overrides child OUs and bypasses Block Inheritance. Security Filtering and WMI Filtering narrow which targets apply a GPO.
#Querying AD with ADUC and PowerShell
Administrators use Active Directory Users and Computers (dsa.msc) to manage accounts, OUs, and delegation, and Group Policy Management (gpmc.msc) to manage GPO links. For repeatable audits, use the PowerShell ActiveDirectory module:
Import-Module ActiveDirectory
# Inspect domain details and PDC emulator
Get-ADDomain | Select-Object DNSRoot, DomainMode, PDCEmulator
# Audit privileged group membership recursively
Get-ADGroupMember -Identity "Domain Admins" -Recursive |
Select-Object Name, SamAccountName, ObjectClass
# List OUs and their Distinguished Names
Get-ADOrganizationalUnit -Filter * | Select-Object Name, DistinguishedNameOn an endpoint, gpresult /r confirms which GPOs won evaluation:
$ gpresult /r /scope:computer
RSOP data for LAB\WKSTN-01 on WKSTN-01 : Logging Mode
-----------------------------------------------------
Applied Group Policy Objects
-----------------------------
Workstation-Hardening-GPO
Default Domain Policy#Defending and common mistakes
- Confusing OUs with Security Groups: Moving a user into
OU=Financegrants no share access. Use security groups for ACLs and OUs for GPO scope and delegation. - Treating a Domain as a security boundary: Compromising a child domain often escalates to the parent forest. Separate trust boundaries by forest.
- Overusing
Domain Admins: Logging into workstations withDomain Adminsexposes Tier 0 credentials; delegate OU rights to separate helpdesk accounts instead. - Unmonitored GPO write rights: Regularly audit GPO permissions and
SYSVOLchanges to prevent policy-based persistence. - Broken internal DNS: Pointing hosts to external DNS breaks SRV discovery, Kerberos, and Group Policy updates.
#Summary
Active Directory structures objects across forests, domains, and OUs, relying on DNS, Kerberos, and LDAP for discovery, authentication, and policy lookup. OUs organize objects for delegation and GPO linking, while security groups govern resource permissions. GPO conflicts follow LSDOU precedence, and auditing group membership and GPO edit permissions with ADUC and PowerShell enforces least privilege.