Sitemap

Active Directory

8 min readJul 20, 2026

--

Press enter or click to view image in full size

What is Active Directory?

In an enterprise network, you have thousands of computers, users, printers, and servers. If a user wants to log into 50 different computers, a network administrator would traditionally have to go to each computer and create a username and password for that user. This is called decentralized management, and it does not scale.

Active Directory Domain Services (AD DS) is Microsoft’s centralized identity and access management system. It acts as a massive, secure, and living database that holds the identities of every user, computer, and devices in an entire organization. Instead of verifying who you are on a local machine, the machine asks Active Directory:

“Is this person who they say they are, and what are they allowed to access?”

Technical Architecture

At its core, Active Directory is an LDAP-compliant (Lightweight Directory Access Protocol) database engine. It uses a structured database file called ntds.dit (New Technology Directory Service Data Information Tree) to store objects. It relies heavily on the Domain Name System (DNS) to locate resources and services within the network, and uses the Kerberos protocol as its primary mechanism for authenticating users safely over the network.

LDAP (Lightweight Directory Access Protocol): Think of this as the universal language or “phonebook protocol” that computers use to talk to the Active Directory database to look up names, emails, or office numbers.

ntds.dit: This is the actual single database file on the hard drive where Windows saves every single user account, password hash, and computer name. If an attacker steals this file, they own the entire network.

DNS (Domain Name System): The GPS of the internet and local networks. It translates human-friendly names (like corp.local) into computer-friendly numbers (IP addresses like 192.168.10.10). Without DNS, Active Directory completely breaks down because computers cannot find the server.

Kerberos: A highly secure ticket-booking system for networks. Instead of sending your password across the network every time you want to open a shared folder, Kerberos gives your computer a digital “ticket.” You show this ticket to other servers to prove you are already logged in.

Active Directory uses several words that sound like they belong in a fantasy novel (forests, trees, domains) or a math textbook (objects, schemas). Let’s untangle this vocabulary completely:

The Logical Hierarchy (The Structure)

  [ Forest: totalcorp.local ]
|
[ Tree: totalcorp.local ] ------ [ Tree: partnercompany.local ] (Trust relationship)
|
[ Domain: corporate.totalcorp.local ]
|
[ Organizational Unit (OU): Accounting ]
|
[ Object: User Account - "John Doe" ]
  • Object: The smallest fundamental building block inside Active Directory. Anything that is an entity in your network is an object. This includes a human user, a physical computer, a network printer, or a security group.
  • Organizational Unit (OU): A structural folder inside a domain used to organize objects. You use OUs to group users or computers together so you can apply specific rules to them or delegate administrative permissions to lower-level IT staff.
  • Domain: A logical boundary of security and administration. All objects inside a domain share the same database policies, security settings, and administration. A domain defines a specific namespace (e.g., corp.local).
  • Tree: A collection or grouping of one or more domains that share a contiguous (linked) naming structure. For example, uk.corp.local and us.corp.local are part of the same tree because they both end in corp.local.
  • Forest: The absolute top-level container in Active Directory. A forest is a collection of one or more domain trees that do not share the same naming structure (e.g., company-a.com and company-b.net), but they do share the exact same database layout (Schema) and global catalog. The Forest is the ultimate security boundary. If you are the Enterprise Administrator of a forest, you own everything inside it.

Object: An individual digital item (like a single user profile or a single laptop entry in the system).

Organizational Unit (OU): A digital file folder inside the network used strictly for organization. For example, putting all the HR employees into an “HR Department” folder so you can give them access to the HR printers easily.

Domain: A digital kingdom. Everyone inside this kingdom follows the exact same laws (e.g., “passwords must be 14 characters long”) and answers to the same king (the Administrator).

Tree & Forest: A “Tree” is a family of kingdoms with the same last name. A “Forest” is a massive empire holding multiple different families or kingdoms together under one massive peace treaty, allowing them to communicate and share resources safely.

The Physical Components (The Machinery)

  • Domain Controller (DC): The physical or virtual Windows Server that runs the Active Directory Domain Services role. The DC holds the copy of the ntds.dit database file. When a user types their password at a desktop, that request travels over the network to the Domain Controller, which processes the login.
  • Global Catalog (GC): A special domain controller that stores a partial, read-only copy of every single object in the entire forest. It acts as a distributed search index so a user in a sub-domain can quickly find an email address or printer located in a completely different domain across the world without querying every server across the empire.

Domain Controller (DC): The actual server machine acting as the security guard/brain of the network. When you log into your work computer, this server checks your password and lets you in.

Global Catalog (GC): A master index or quick-search directory. It allows a worker in London to instantly find a phone number for a worker in Tokyo without making a slow, lagging network search through Japan’s local servers.

Advanced Concepts: Schemas and FSMO Roles

you must understand what happens behind the scenes when multiple Domain Controllers need to coordinate changes without conflicting with one another.

The Active Directory Schema

The Schema is the blueprint or master definition file for the entire Active Directory database. It defines every type of object that can exist (e.g., a “User” object) and what attributes that object is allowed to have (e.g., “First Name”, “Phone Number”, “Password”). If you want to add a custom field to every user account — like an “Employee Badge ID Number” — you have to modify the Schema.

FSMO Roles (Flexible Single Master Operation)

Active Directory is a multi-master database. This means if you have five Domain Controllers, you can update a user’s password on any of them, and they will automatically copy (replicate) that change to the other four servers.

However, if two administrators try to make conflicting changes at the exact same millisecond, the database could corrupt. To prevent this, Active Directory assigns 5 highly specific tasks to single individual Domain Controllers. These are called FSMO Roles:

Schema: The master rules/blank template sheet. It dictates exactly what boxes are available to fill out when creating a new account.

FSMO Roles: A group of 5 specific “referee” jobs given to servers to prevent confusion. For example, the PDC Emulator acts as the master clock for the whole network so all computers are synchronized down to the exact second, preventing hacking attempts that exploit time delays. The RID Master acts like a ticket dispenser at a deli counter, ensuring every new computer or user gets a completely unique ID number so the system never mixes up two accounts.

  [ Step 1: Base Config ] ---> [ Step 2: Install AD Feature ] ---> [ Step 3: Deploy Forest ] ---> [ Step 4: Populate via Script ]
- Rename-Computer - Install-WindowsFeature - Install-ADDSForest - Import-Csv
- New-NetIPAddress - Name AD-Domain-Services - DomainName "corp.local" - New-ADUser

How to write Powershell Commands

PowerShell relies on a highly predictable structure called the Verb-Noun pattern. If you learn this pattern, you can easily write your own commands or guess how to do things without looking them up.

[Verb]-[Noun] -[ParameterName] [Value] -[SwitchParameter]

The Verb-Noun

Every core action is built as Verb-Noun (always singular, always separated by a hyphen).

Get Amrsmooke’s stories in your inbox

Join Medium for free to get updates from this writer.

Verbs are standard approved words. Common ones include:

  • Get (Retrieve info)
  • Set (Modify info)
  • New (Create something)
  • Remove (Delete something)
  • Restart (Reboot/Stop and Start)

Nouns are the specific components of the system you want to manage (e.g., Service, Process, NetIPAddress, LocalUser).

Parameters and Values

To give the command specific instructions, you use parameters.

  • Parameters always start with a hyphen (-ParameterName).
  • Arguments/Values follow the parameter to give it data (e.g., -IPAddress 10.0.0.5).
  • If a value has spaces or special characters, you wrap it in quotation marks (-NewName "My New Server").

Switches

Switches are just parameters that don’t need a value following them. Their presence alone turns a feature “on.”

  • Example: Adding -Restart at the end tells the command "Yes, do a reboot right now." Leaving it off means "Don't reboot."

Example of applying the pattern:

If you want to look up active software processes running on your computer:

  • Verb: Get
  • Noun: Process
  • Command: Get-Process

If you want to stop a specific process called Notepad:

  • Verb: Stop
  • Noun: Process
  • Parameter: -Name
  • Value: "notepad"
  • Command: Stop-Process -Name "notepad"

Step 1: Base Configuration

Boot up your fresh Windows Server VM. Do not touch the Server Manager GUI. Open PowerShell as an Administrator. Run these commands to configure your network interface and server name:

# 1. View your network adapters to find the Interface Index (IfIndex)
Get-NetAdapter

# 2. Set a static IP address (Replace 6 with your actual IfIndex number)
New-NetIPAddress -InterfaceIndex 6 -IPAddress 192.168.10.10 -PrefixLength 24 -DefaultGateway 192.168.10.1

# 3. Set the DNS server to point to itself (since this server will become the DNS server)
Set-DnsClientServerAddress -InterfaceIndex 6 -ServerAddresses 127.0.0.1

# 4. Rename the computer to a standard Domain Controller naming convention
Rename-Computer -NewName "MASTER-DC01" -Force -Restart

Step 2: Install and Promote Active Directory

Once the server reboots, reopen PowerShell and run the deployment commands:

# 1. Install the Active Directory Domain Services binaries onto the operating system
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

# 2. Create a brand new Forest and Domain. (This will prompt you to type a Safe Mode password)
Install-ADDSForest -DomainName "master.local" -ForestMode WinThreshold -DomainMode WinThreshold -InstallDns:$true -Force:$true

(Note: WinThreshold is the internal technical designation for Windows Server architectural levels).

Step 3: Mass Populate Users via Automated Scripting

True automation involves scripting. Create a plain text file named users.csv with headings for users you want to build

Firstname,Lastname,Username,Department
Alice,Smith,asmith,Accounting
Bob,Jones,bjones,Security
Charlie,Brown,cbrown,IT

Then execute this script to build out your OUs and read that CSV to generate all your network users instantly:

# 1. Create Organizational Units to structure your corporate environment
New-ADOrganizationalUnit -Name "Corporate_Objects" -Path "DC=master,DC=local"
New-ADOrganizationalUnit -Name "Staff" -Path "OU=Corporate_Objects,DC=master,DC=local"

# 2. Read the CSV file and loop through it to build accounts with randomized safe passwords
$Users = Import-Csv -Path "C:\path\to\users.csv"
foreach ($User in $Users) {
$SecurePassword = ConvertTo-SecureString "InitialPassword123!" -AsPlainText -Force

New-ADUser -Name "$($User.Firstname) $($User.Lastname)" `
-SamAccountName $User.Username `
-UserPrincipalName "$($User.Username)@master.local" `
-GivenName $User.Firstname `
-Surname $User.Lastname `
-Path "OU=Staff,OU=Corporate_Objects,DC=master,DC=local" `
-AccountPassword $SecurePassword `
-ChangePasswordAtLogon $true `
-Enabled $true
}

In a Nutshell

Active Directory (AD) is a centralized master identity phonebook database (ntds.dit) used by companies to manage users and computers from one single server called a Domain Controller (DC). a Forest is your entire corporate digital empire, a Domain is a single kingdom inside that empire governed by matching security laws, and OUs are folders inside that kingdom used to group items cleanly.

Instead of dealing with repetitive clicks in a slow graphic interface (GUI), real experts use PowerShell CLI scripting to deploy whole systems instantly using code.

--

--