AD.CLOUDSCHOOL.AI · PAGE 02 OF 14

Basic Active Directory setup

Prerequisites, installing AD DS, promoting the first and extra domain controllers, RODCs, post-install checklist and admin tools.

Before you install

  • Name the forest root domain: use a subdomain of a domain you own, such as corp.contoso.com or ad.contoso.com. Avoid .local and single-label names. Renaming later is painful.
  • NetBIOS name: 15 characters max, such as CORP. Users see it in CORP\alice.
  • Static IP on every DC, and a plan for which DNS servers each DC and client uses.
  • Time: Kerberos allows 5 minutes of clock skew. The forest root PDC emulator syncs to a reliable external source.
  • Hardware or VM: Server Core is preferred for DCs (smaller attack surface). On hypervisors, use VM-GenerationID-aware platforms (Hyper-V, current VMware) and never restore DCs from VM snapshots outside of supported recovery.
  • Functional level: new forests need Windows Server 2016 level or higher. Windows Server 2025 adds its own level (needed for the optional 32k database pages).
  • DSRM password: the Directory Services Restore Mode password is your way in for offline repairs. Store it in your password vault.

Install the first domain controller (new forest)

# 1. Rename and set a static IP first, then reboot
Rename-Computer -NewName DC01 -Restart
New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 10.0.0.10 -PrefixLength 24 -DefaultGateway 10.0.0.1
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 127.0.0.1

# 2. Install the role binaries
Install-WindowsFeature AD-Domain-Services, DNS -IncludeManagementTools

# 3. Promote: creates the forest, the domain and AD-integrated DNS
Install-ADDSForest `
  -DomainName corp.contoso.com -DomainNetbiosName CORP `
  -ForestMode Win2025 -DomainMode Win2025 `
  -InstallDns -SafeModeAdministratorPassword (Read-Host -AsSecureString "DSRM password")

The server reboots as the first DC. It now holds all five FSMO roles, is a global catalog and hosts the _msdcs and domain DNS zones. Use -ForestMode WinThreshold (2016 level) instead if older DCs must join later.

The GUI path is the same: Server Manager → Add Roles and Features → Active Directory Domain Services, then the flag notification → Promote this server to a domain controller. The last wizard page can export the matching PowerShell script.

Add more domain controllers

Always run at least two DCs per domain, ideally in different hosts, racks or sites.

# Point DNS to an existing DC, then:
Install-WindowsFeature AD-Domain-Services, DNS -IncludeManagementTools
Install-ADDSDomainController -DomainName corp.contoso.com -InstallDns `
  -SiteName HQ -Credential (Get-Credential CORP\Administrator)

# Read-only DC for a branch office
Install-ADDSDomainController -DomainName corp.contoso.com -ReadOnlyReplica `
  -SiteName Branch1 -InstallDns -Credential (Get-Credential)

# Large database? Install from media created with: ntdsutil "ac i ntds" "ifm" "create sysvol full C:\IFM" q q
Install-ADDSDomainController -DomainName corp.contoso.com -InstallationMediaPath C:\IFM

New child domains or trees use Install-ADDSDomain. Demote with Uninstall-ADDSDomainController, then clean up any leftovers of a dead DC with metadata cleanup (delete the DC object in AD Sites and Services or ADUC).

Post-install checklist

  1. Check health: dcdiag /v, repadmin /replsummary, Get-Service adws,kdc,netlogon,ntds,dns.
  2. Point each DC's DNS to a partner DC first and itself (127.0.0.1) second.
  3. Add DNS forwarders and reverse lookup zones; turn on aging and scavenging.
  4. Configure the PDC emulator as the authoritative time source (see NTP).
  5. Create sites and subnets that match your network (see Sites and subnets).
  6. Enable the AD Recycle Bin: Enable-ADOptionalFeature 'Recycle Bin Feature' -Scope ForestOrConfigurationSet -Target corp.contoso.com.
  7. Create the Group Policy Central Store: copy C:\Windows\PolicyDefinitions to \\corp.contoso.com\SYSVOL\corp.contoso.com\Policies\PolicyDefinitions.
  8. Build your OU structure, redirect new computers and users out of the default containers: redircmp, redirusr.
  9. Rename or protect the built-in Administrator, set a long unique password, and create named admin accounts.
  10. Deploy Windows LAPS, set up backups (see Backup) and enable advanced auditing on DCs.

Admin tools you will use

ToolUse it for
AD Administrative Center (dsac.exe)Modern console: users, groups, Recycle Bin, fine-grained password policies, PowerShell history viewer.
AD Users and Computers (dsa.msc)Classic console for objects, OUs and delegation. Turn on View → Advanced Features.
AD Sites and Services (dssite.msc)Sites, subnets, site links, NTDS settings and replication connections.
AD Domains and Trusts (domain.msc)Trusts, UPN suffixes, functional levels.
ADSI Edit (adsiedit.msc)Raw LDAP editing of any partition. Powerful and dangerous.
Group Policy Management (gpmc.msc)Create, link, filter, back up and model GPOs.
AD PowerShell moduleGet-ADUser, New-ADGroup, Search-ADAccount -LockedOut, Get-ADReplicationFailure and about 150 more.
Command-linedcdiag, repadmin, nltest, ntdsutil, dsquery, setspn, w32tm, klist, gpresult.
Get-ADUser -Filter 'Enabled -eq $true' -Properties LastLogonDate | Sort LastLogonDate | Select -First 20
New-ADOrganizationalUnit -Name Workstations -Path "OU=Corp,DC=corp,DC=contoso,DC=com"
New-ADUser -Name "Alice Smith" -SamAccountName alice -UserPrincipalName alice@contoso.com -Enabled $true -AccountPassword (Read-Host -AsSecureString)
Add-ADGroupMember -Identity "GG-Finance" -Members alice
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -ComputersOnly