Admin Power Level: Intermediate Chapter 11: Manage People, Computers, and Names

Forest, domain, and domain controllers

A forest is the top level of Active Directory. It holds domains, and each domain holds domain controllers, which are the servers that answer logon and directory requests.

Lesson 3 of 6 in Chapter 11: Manage People, Computers, and Names. Previous step in this path: AD computers: join, read, and disconnect. 3 learning objectives, 6 examples, and a knowledge check.

Start: what you will learn

A forest is the top level of Active Directory. It holds domains, and each domain holds domain controllers, which are the servers that answer logon and directory requests.

Learning objectives

  • Explain forest, domain, and domain controller in order
  • Describe installing a first forest and adding a controller
  • Explain what RootDSE is used for

Concept in simple words

What it is: A forest is the top level of Active Directory, a domain is a boundary for policy and replication inside that forest, and a domain controller is a server that holds a copy of the domain directory and answers logon requests.

Why it works

Why it works this way: A forest holds domains that share a schema, which is the set of rules for what kinds of objects and facts the directory can hold, plus shared configuration and a global catalog, which is an index that helps find objects across the forest. Each domain controller holds a copy of its domain, so logons still work even if one controller is busy or offline, and changes replicate, which means they copy, between controllers.

Think of it like this

Think of it like this: A forest is like a whole school district, a domain is like one school inside it, and a domain controller is like the school office that checks IDs and keeps the student records. The district shares the same rules, each school runs its own daily work, and the office is where you go when you need to prove who you are.

How it works, step by step

How it works, step by step: First, the very first domain controller in a new forest is created with Install-ADDSForest, which creates the forest, the first domain, and DNS for it. Later controllers join an existing domain with Install-ADDSDomainController, which adds a replica, which is another copy, to that domain.

Next, before either install, run the matching prerequisite test, Test-ADDSForestInstallation for a forest install, Test-ADDSDomainInstallation for a new domain inside an existing forest, and Test-ADDSDomainControllerInstallation for adding a controller, because these tests check whether the install can succeed without making changes. Both installs need a Windows Server with the AD DS role, which is the Active Directory Domain Services role, and the right permissions, and they change the server deeply, so they belong in a server lab, never on a normal workstation.

Let us walk through an example: In Test-ADDSDomainInstallation -DomainName "example.local", -DomainName names the domain you plan to create, and the test reports whether the server is ready, without installing anything. Look for a pass result, and if the test fails, read its reason carefully, because fixing that reason now is far easier than failing halfway through a real install.

When to use it

When to use it, and when not to: Use the prerequisite tests whenever you plan a forest or controller install, and use the install cmdlets only in a server environment you are allowed to change. Do not run a forest install on a workstation, on a computer with data you care about, or on a production server by accident, and do not skip the test just because you are in a hurry, because the test exists to catch exactly the problems that waste the most time later.

Start from zero, with why a directory needs levels at all: A small lab can live with one domain and one controller, but a large organisation has many sites, many teams, and many rules. One flat list of every user and computer would be unmanageable, and one single server would be a single point of failure. Active Directory therefore splits the problem into levels. The forest sets the shared rules for the whole system, each domain sets its own policy and replication boundary inside that forest, and each domain controller is a working server that answers real logon and lookup requests.

What happens behind a logon: When a domain user logs on, the computer asks DNS for a domain controller, the controller checks the user account and password against its copy of the directory, and it answers yes or no. Because every controller holds a copy of its domain, another controller can answer if the first one is busy or offline. Changes are not magic either. When an administrator creates a user on one controller, that controller copies the change to the other controllers, which is called replication. Replication takes time, so a brand new user may not be visible on every controller in the very first seconds, and that delay is normal, not a failure.

The schema, in plain words: The schema is the rule book for what the directory can hold. It defines which kinds of objects exist, such as users, computers, and groups, and which facts each kind can carry, such as a name, a department, or an enabled state. All domains in one forest share one schema, so a user object means the same thing everywhere in that forest. The configuration is the shared setup information for the forest, and the global catalog is an index that helps find objects across domains in the forest, without searching every domain one by one.

Forest, tree, and domain, kept straight: A forest is the top boundary. Inside a forest there can be one domain or several domains, arranged as trees. A tree is a set of domains linked by a naming chain, while a forest can hold more than one tree. In practice for your lab, start with the simple picture, one forest, one domain, one or two controllers, and only add more domains when you have a clear reason, because every extra domain adds replication, DNS, and troubleshooting work.

The install order, step by step: First, prepare a proper server, with a fixed address and DNS set correctly, because a controller that cannot be found by DNS cannot serve its domain. Second, install the Active Directory Domain Services role, which gives the server the AD DS tools and the ADDSDeployment module. Third, run the matching prerequisite test, which checks readiness without making changes. Fourth, run the matching install cmdlet. Fifth, restart when told to, then verify with Get-ADDomainController and a simple directory read, because an install you never verify is only an assumption.

Let us walk through the forest test, part by part: In Test-ADDSForestInstallation -DomainName "example.local", -DomainName names the domain you plan to create, and the test part of the name is the whole point, because a Test cmdlet runs prerequisite checks only and installs nothing. Look for a pass result, and if the test fails, read its reason carefully. Fixing that reason now is far easier than failing halfway through a real install, when the server is already half changed.

Let us walk through the forest install, with a strong warning: Warning, this command creates a forest and a first domain, restarts the server, and changes it deeply, so use it only on a lab server you are allowed to rebuild. In Install-ADDSForest -DomainName "example.local" -InstallDns -SafeModeAdministratorPassword $password, -DomainName names the new domain, -InstallDns asks the install to set up DNS for the domain, and -SafeModeAdministratorPassword supplies the separate recovery password used in Directory Services Restore Mode, which is a special repair mode for a domain controller. Get that password from a secure prompt with Read-Host -AsSecureString, never type a real password in plain text in a script file.

What Get-ADForest and Get-ADDomain tell you: Get-ADForest reads forest facts, including its name and its domains, and Get-ADDomain reads domain facts for the current domain. These are read only checks, they change nothing, and they are the calm way to confirm what you actually built, instead of trusting your memory of what you meant to build. If Get-ADForest shows a different forest name than you planned, stop and work out why before you create users or join computers to the wrong forest.

Adding a second controller, and why you would: A second controller gives you a second copy of the domain and a second server to answer logons, so one failure does not stop every logon. The cmdlet is Install-ADDSDomainController, and its test is Test-ADDSDomainControllerInstallation, which you saw in the examples. The new controller joins the existing domain, it does not create a new forest, and after promotion it needs time to replicate before you treat it as fully ready. Check it with Get-ADDomainController, and confirm it answers directory queries, before you rely on it.

What this lesson does not cover: This lesson does not go into the special flexible single master roles, sometimes called FSMO roles, and it does not go into site design or detailed replication topology. Those topics matter in large production forests, but they are not needed to understand the forest, domain, and controller picture, and they are left out here rather than guessed at. Learn the three levels first, get a lab forest working, and add those advanced topics only when you have a real multi site reason to need them.

Worked examples

Read each example in order. Each one explains its parts, then shows what to look for in the output.

Syntax

Syntax
Install-ADDSForest -DomainName <Domain> (server only)

Example 1

A prerequisite test for a new domain inside an existing forest. It checks readiness without installing anything. For a brand new forest, use Test-ADDSForestInstallation instead.

Example 1
Test-ADDSDomainInstallation -DomainName "example.local"

Illustrative output: Test passed. The forest can be installed.

Example 2

Lists domain controllers in the current domain, with their domain names.

Example 2
Get-ADDomainController -Filter * | Select-Object Name, Domain

Illustrative output: Name Domain ---- ------ DC01 example.local

Example 3

This is the prerequisite test for adding a domain controller to an existing domain, and it is the partner of the forest test in the lesson. -DomainName names the existing domain you plan to join. The test checks readiness, such as credentials and network basics, without installing anything and without changing the server, so it is safe to run as a check, but the real install still needs a proper server environment and the right permissions.

Example 3
Test-ADDSDomainControllerInstallation -DomainName "example.local"

Illustrative output: Test passed. The server is ready to become a domain controller.

Example 4

The correct prerequisite test for a brand new forest. It checks readiness without installing anything. Do not use the domain test here, because that test is for a new domain inside an existing forest.

Example 4
Test-ADDSForestInstallation -DomainName "example.local"

Illustrative output: Test passed. The forest can be installed.

Example 5

Warning: this creates a forest and a first domain, and it restarts the server, so use it only on a lab server you are allowed to rebuild. The first line asks for the recovery password as a secure string. -InstallDns sets up DNS for the new domain.

Example 5
$password = Read-Host -AsSecureString "Enter the recovery password"
Install-ADDSForest -DomainName "example.local" -InstallDns -SafeModeAdministratorPassword $password

Illustrative output: Forest example.local created. Restarting.

Example 6

A read only forest check. Name shows the forest name, and Domains shows the domains inside that forest, so you can confirm you built what you planned.

Example 6
Get-ADForest | Select-Object Name, Domains

Illustrative output: Name Domains ---- ------- example.local example.local

Nothing on this page executes PowerShell code. The outputs above are illustrative only.

Common mistakes and troubleshooting

Read these before you try the examples, so you can spot the same problems in your own work.

  • Running a forest install on a workstation or a production server by accident. These commands rebuild server roles.
  • Skipping the prerequisite test, then failing halfway through an install for a reason the test would have caught.
  • Confusing the two install cmdlets, and running a forest install when you meant to add a controller to an existing domain, which creates a whole new forest instead of joining the one you wanted.
  • Testing a forest install with Test-ADDSDomainInstallation, which is the wrong test, because that test is for a new domain inside an existing forest, while a forest install needs Test-ADDSForestInstallation.
  • Promoting a server whose DNS points nowhere useful, then wondering why clients cannot find the new domain, when DNS had to be correct before the promotion, not after it.
  • Treating a second controller as ready the second promotion finishes, when replication still needs time, so verify with Get-ADDomainController and a directory read before you rely on it.

Knowledge check

Knowledge check

Which command creates the first domain in a new forest?

Pick one answer. Feedback appears right away, and you can try again.

Remember this and next step

Remember this: Forest at the top, domain inside it, controller as the server that does the work, test before you install, and keep all of this firmly inside a proper server environment.

Next step: RootDSE and why DCPromo fails