Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 38 ยท Active Directory Structure

Organizational Units and Containers

Learn how Active Directory organizes objects with OUs and built-in containers, how to design an OU structure, delegate control, link Group Policy and protect OUs from deletion.

Inside an Active Directory domain, objects live in containers. The most important container for administrators is the organizational unit (OU). OUs are the unit you use to organize objects, delegate administration and apply Group Policy. Designing them well saves years of cleanup; designing them badly creates a tangle that nobody dares touch.

This lesson explains the difference between OUs and the built-in containers, the principles of a good OU design, delegation of control, the protection against accidental deletion and the PowerShell and LDAP commands to manage OUs. A Python stand-in checks a proposed structure against good-practice rules.

OUs and generic containers

Active Directory has two main kinds of folder:

Kind Object class Typical RDN Can link Group Policy? Can delegate easily?
Organizational unit organizationalUnit OU=Sales Yes Yes
Container container CN=Users No Limited

A fresh domain has these built-in containers: CN=Users, CN=Computers, CN=Builtin, CN=Managed Service Accounts, CN=System and others, plus one OU, OU=Domain Controllers. New users created without a path (net user /add /domain for example) land in CN=Users, and new computers joined to the domain land in CN=Computers. You cannot link a Group Policy to a container, so administrators create OUs and move accounts into them, and redirect the defaults with redirusr and redircmp.

Why OUs exist

Organize Group users and computers sensibly.
Delegate Give a team rights over one OU.
Apply policy Link Group Policy to an OU.

Containers cannot link policy

1 / 2

Designing an OU structure

The right question is not "What does our org chart look like?" but "How will we administer and configure these objects?" Two uses decide the layout: delegation (who manages what) and Group Policy (which settings apply to what).

A popular, simple layout separates object type at the top and location or function below:

TEXT
DC=corp,DC=example,DC=com
โ”œโ”€โ”€ OU=Domain Controllers          (built in)
โ”œโ”€โ”€ OU=Corp
โ”‚   โ”œโ”€โ”€ OU=Users
โ”‚   โ”‚   โ”œโ”€โ”€ OU=Staff
โ”‚   โ”‚   โ””โ”€โ”€ OU=Contractors
โ”‚   โ”œโ”€โ”€ OU=Workstations
โ”‚   โ”‚   โ”œโ”€โ”€ OU=Laptops
โ”‚   โ”‚   โ””โ”€โ”€ OU=Desktops
โ”‚   โ”œโ”€โ”€ OU=Servers
โ”‚   โ”‚   โ”œโ”€โ”€ OU=Web
โ”‚   โ”‚   โ””โ”€โ”€ OU=Database
โ”‚   โ”œโ”€โ”€ OU=Groups
โ”‚   โ”‚   โ”œโ”€โ”€ OU=Security
โ”‚   โ”‚   โ””โ”€โ”€ OU=Distribution
โ”‚   โ””โ”€โ”€ OU=Service Accounts
โ””โ”€โ”€ OU=Disabled

Good practices:

  • Put all your OUs under one top-level OU (here Corp). It keeps your objects separate from built-ins and makes policy blocking and delegation easier.
  • Separate users from computers. Their Group Policy settings differ, and so does their lifecycle.
  • Keep servers separate from workstations. Servers need stricter policy and different admins.
  • Create a "Disabled" or "Quarantine" OU for departed users, with a policy and access rule for cleanup.
  • Avoid deep nesting. Policy inheritance gets hard to reason about past five levels.
  • Name OUs clearly and consistently (no spaces if you script heavily, though AD allows them).
  • Do not rely on OUs for security groups or email lists. Group membership, not location, grants access.

Moving objects between OUs is cheap in AD (no password or SID change) but changes their DN and the Group Policy they receive, so test before moving many.

Delegating control

OUs let you hand specific powers to a team without making them domain admins. Examples: "Helpdesk can reset passwords and unlock accounts in OU=Staff", "The desktop team can join computers to OU=Workstations".

In ADUC, right-click the OU and select Delegate Control...; the wizard offers common tasks:

  • Create, delete and manage user accounts.
  • Reset user passwords and force password change at next logon.
  • Read all user information.
  • Create, delete and manage groups.
  • Modify the membership of a group.

Under the hood, delegation adds access control entries (ACEs) to the OU's security descriptor (nTSecurityDescriptor). You can inspect and change them in ADUC's Advanced Features view under Security, or by using dsacls. Delegate to groups, never to individual users, and use the least privilege.

Protection from accidental deletion

An OU deleted by mistake takes everything inside with it. When you create an OU with ADUC or the PowerShell cmdlet, AD sets Protect object from accidental deletion, which adds a Deny delete ACE for Everyone. To delete such an OU you first clear the flag on the Object tab (enable View > Advanced Features first).

Working with OUs

Creating an OU with PowerShell:

POWERSHELL
New-ADOrganizationalUnit -Name "Corp" -Path "DC=corp,DC=example,DC=test" -ProtectedFromAccidentalDeletion $true
New-ADOrganizationalUnit -Name "Users" -Path "OU=Corp,DC=corp,DC=example,DC=test"
Get-ADOrganizationalUnit -Filter * | Select-Object Name, DistinguishedName

Moving a user to another OU:

POWERSHELL
Move-ADObject -Identity "CN=Alice Smith,CN=Users,DC=corp,DC=example,DC=test" `
              -TargetPath "OU=Staff,OU=Users,OU=Corp,DC=corp,DC=example,DC=test"

The LDAP view of an OU is an entry with objectClass: organizationalUnit, an ou value and a gPLink attribute listing linked Group Policy objects. A search for all OUs:

Terminal
ldapsearch -LLL -H ldaps://dc1.corp.example.test -D "[email protected]" -W \
  -b "DC=corp,DC=example,DC=test" -s sub "(objectClass=organizationalUnit)" ou distinguishedName

Checking a design (Python stand-in)

A script that audits a proposed list of OU DNs against rules: a maximum depth, no spaces in names (a style rule for scripting), and a required top-level OU. It is a stand-in for the review you would do by hand.

Python OU design checker

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The deepest OU breaks the depth rule; the names with spaces trigger the style hint. That is the kind of check you can keep in a design review script.

Mapping a DN to inheritance

Group Policy flows down the OU tree, so a DN tells you which policies apply. The second stand-in lists the chain of containers that could contribute policy to an object, from the domain down to its OU.

Python Policy inheritance chain

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

When troubleshooting "why did this policy apply?", read the DN right to left and list every OU on the way. Group Policy processing walks that same chain.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why create OUs instead of using the built-in CN=Users container?

    Group Policy can only be linked to domains, sites and OUs, not to generic containers.
  2. 2. How should you design the OU structure?

    OUs are for administration and policy. Org charts change; administration needs are steadier.
  3. 3. What does Protect object from accidental deletion do?

    It adds a Deny delete ACE for Everyone.
  4. 4. To whom should you delegate control of an OU?

    Delegating to groups makes access auditable and easy to change.

Summary

  • OUs organize objects, enable delegation and are the unit for Group Policy; built-in containers cannot link policy.
  • Design OUs around administration and policy, with a single top OU, shallow depth and separate users, computers and servers.
  • Delegate control to groups with the least privileges needed through the wizard or ACLs.
  • Keep accidental-deletion protection on; clear it only when you really must delete.
  • Moving an object changes its DN and the policies it receives.

Next: Users, Computers and Groups