Active Directory Series

🛠️ Hands-On: Building a Multi-Domain, Multi-Tree AD Forest — Seeing the Boundary Between Trees and Forests With Your Own Eyes

Introduction

This article is part of the Top 1% Series’ full article guide, and the fourteenth article in the Active Directory series. This is a hands-on (get-your-hands-dirty) article, positioned as a capstone for the deep-dive articles that came before it. Reading Understanding the Difference Between AD and DC, and Domains vs. Forests, What’s the Difference Between sysdm.cpl and netdom computername?, Understanding FSMO (Operations Master) Roles, and Understanding AD “Sites” and Replication Topology beforehand is strongly recommended. For how to build the VMs themselves, see the hands-on prep manual and initial setup for Windows Server.

Prerequisites

This hands-on lab assumes you’re already familiar with the content of the AD DS series so far. Three points in particular are essential:

Prerequisites for the Hands-On

Getting the Big Picture

The Environment You’ll Build

graph TB
    subgraph Forest["Forest: example.com"]
        subgraph Tree1["Tree 1"]
            Root["DC1: example.com<br/>(forest root domain)"]
            Child["DC2: child.example.com<br/>(a child domain of example.com)"]
            Root -->|Automatic parent-child trust| Child
        end
        subgraph Tree2["Tree 2 (a separate tree in the same forest)"]
            Tree["DC3: example.net<br/>(a tree root domain)"]
        end
        Root <-.Automatic inter-tree trust.-> Tree
    end

The Overall Flow of Work

  1. Step 0: Build DC1 as the first DC of the example.com forest root domain
  2. Step 1: Promote DC2 as child.example.com, a child domain of example.com
  3. Step 2: Promote DC3 as example.net, a separate tree in the same forest as example.com
  4. Verifications 1–5: Confirm partition isolation, trust relationships, the global catalog, and FSMO placement with real commands

Step 0: Build DC1 as the example.com Forest Root Domain

On DC1, open PowerShell as administrator, add the AD DS role, and then create the forest.

# Add the AD DS role (no reboot required)
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

# Create a new forest (also installs the DNS server role)
Install-ADDSForest `
    -DomainName "example.com" `
    -DomainNetbiosName "EXAMPLE" `
    -InstallDns `
    -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssw0rd-DSRM!" -AsPlainText -Force)

-SafeModeAdministratorPassword is the password used for DSRM (Directory Services Restore Mode) — a dedicated recovery mode for when the AD DS database itself is corrupted. Keep it recorded separately, since it’s distinct from your ordinary domain administrator account. After running the command and following the confirmation prompts, the machine reboots automatically and DC1 comes up as the first DC of example.com.

After the reboot, change DC2 and DC3’s DNS settings from their temporary self-reference to DC1’s IP address (at this point, DC2 and DC3 haven’t joined the domain yet).

Step 1: Promote DC2 as the Child Domain child.example.com

On DC2, after adding the AD DS role, promote it as a child domain of the existing forest (example.com). This operation requires credentials with Enterprise Admin privileges in example.com.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSDomain `
    -NewDomainName "child" `
    -ParentDomainName "example.com" `
    -DomainType "ChildDomain" `
    -InstallDns `
    -Credential (Get-Credential "EXAMPLE\Administrator") `
    -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssw0rd-DSRM!" -AsPlainText -Force)

-NewDomainName takes only a single label (child), while -ParentDomainName specifies the parent domain’s fully qualified name (example.com). Together, these create a domain whose full name is child.example.com.

Step 2: Promote DC3 as the Separate Tree example.net

On DC3, similarly add the AD DS role, and then promote it as a new tree in the existing forest. The difference from the child domain is that you specify TreeDomain for -DomainType, and the fully qualified name (example.net) for -NewDomainName.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSDomain `
    -NewDomainName "example.net" `
    -ParentDomainName "example.com" `
    -DomainType "TreeDomain" `
    -InstallDns `
    -Credential (Get-Credential "EXAMPLE\Administrator") `
    -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssw0rd-DSRM!" -AsPlainText -Force)

Note that -ParentDomainName still specifies example.com. This doesn’t mean example.net becomes a “child” of example.com — this parameter specifies “join the same forest that example.com belongs to, as a new tree.” The two tree roots (example.com and example.net) remain unrelated as DNS namespaces, while becoming members of the same forest.

A common snag around this point: the forward lookup zone doesn't show up

During the promotion of child.example.com or example.net, you may hit an error where delegation to the parent domain’s DNS zone doesn’t go smoothly and the zone doesn’t show up correctly. In many cases, this is because DC2 or DC3’s DNS server setting can’t correctly reach example.com (DC1). Run nslookup example.com before promoting to confirm DC1 resolves correctly, then retry.

Verification 1: Confirming Domain Partition Isolation

Once all three DCs have finished being promoted, first confirm that the domain partition really is isolated.

Create a new test user (say, test-root-user) in DC1’s (example.com) ADUC (dsa.msc), then open ADUC on DC2 (child.example.com) and DC3 (example.net) and confirm that user doesn’t show up at all on either one. This is because the domain partition only replicates among DCs within the same domain, and never replicates to any other domain at all.

Verification 2: Confirming the Configuration and Schema Partitions Are Shared

Next, confirm that the configuration and schema partitions are shared across the entire forest. The clearest way to see this is with the site information covered in Understanding AD “Sites” and Replication Topology.

On DC1, open dssite.msc (Active Directory Sites and Services) and create a new site (say, Test-Site). After waiting a bit (or forcing synchronization with repadmin /syncall), open dssite.msc on DC2 and DC3 and confirm the Test-Site you created shows up on both. In contrast to the user object in Verification 1, site information belongs to the configuration partition, so it replicates to every DC in the entire forest.

Verification 3: Confirming Automatic Trust Relationships

Use the netdom command to check the trust relationships between domains. Run the following on DC1:

netdom query trust

You can confirm that, from example.com’s perspective, both a parent-child trust with child.example.com and a tree-root trust with example.net already exist automatically — despite never having manually configured either. Both of these trust relationships are bidirectional and transitive, meaning that, for example, a child.example.com user could technically access resources in example.net (given appropriate permissions), as long as it’s all within the same forest.

Among DC1, DC2, and DC3, the first DC of each domain has the global catalog (GC) enabled by default. From DC3’s (example.net) ADUC, try searching for the user you created on child.example.com using the search feature. By switching the search scope from the local domain to a GC-based search across the entire forest (via ADUC’s “Search” → “Entire Directory” menu, or by searching the whole forest from Active Directory Administrative Center), you can confirm that DC3 can directly search for objects in child.example.com. This is a concrete example of the mechanism covered in Understanding the Difference Between AD and DC, and Domains vs. Forests — that “a single query to the GC completes a forest-wide search.”

Verification 5: Confirming FSMO Placement

Finally, actually confirm the placement of the five roles covered in Understanding FSMO (Operations Master) Roles.

netdom query fsmo

Running this command on DC1, DC2, or DC3 — it doesn’t matter which — confirms that the Schema Master and Domain Naming Master are always held solely by DC1 (the very first DC built in the forest). Meanwhile, you can also confirm that the RID Master, PDC Emulator, and Infrastructure Master each exist independently in example.com (DC1), child.example.com (DC2), and example.net (DC3), respectively. This directly reflects FSMO’s design — some roles held once for the entire forest, others held once per domain.

The View From the Top 1% Perspective

How to Choose Between “Separate Domain,” “Separate Tree,” and “Separate Forest” in Practice

Each of the three patterns built in this hands-on lab has a distinct real-world reason for being chosen.

Common Errors and How to Handle Them

Cleaning Up the Lab Environment

Once you’re done verifying, demote the child domain and separate tree first, and the forest root last (doing it in the reverse order leaves a dependent domain behind after the forest root is already gone, which is much harder to untangle).

# Run this on DC2 and DC3 first (each is the last DC in its domain, so the whole domain gets removed)
Uninstall-ADDSDomainController -LastDomainControllerInDomain -DemoteOperationMasterRole -Force

# Run this on DC1 last (the last DC of the last domain in the forest, so the whole forest gets removed)
Uninstall-ADDSDomainController -LastDomainControllerInDomain -DemoteOperationMasterRole -Force

Summary

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).