Bookmarks
ReferenceNetworks & sysadminVerified

Windows Server and AD

Windows Server and Active Directory: the server edition of Windows and the domain directory service. The reference covers PowerShell, domains, controllers, group policy and DNS.

checked 7 Nov · next check 14 Nov · 69 min read

Sections
13
Reading
69 min
Current version
26100.33674 (2026-10 OOB, KB5134137)
Written from
learn.microsoft.com/en-us/windows-server

Check status of the reference

Verified 7 Nov · next check 14 Nov

The sections were compared with the release notes, the check found nothing, and all source links respond.

  1. Verified
  2. Scheduled check

What Windows Server and AD are and how they work

Windows Server is a server operating system used to build an organisation’s infrastructure: an account directory, DNS and DHCP, file services, Hyper-V virtualisation. Its main role is Active Directory Domain Services (AD DS): a single database of users, computers and policies for the whole network.

You need a domain when an office has ten or more Windows computers: one password works on every machine, and an administrator grants permissions from a single place. A couple of Linux servers do not need a domain; separate local accounts are enough for them.

AD DS is a directory service: it stores objects (user, computer, server and printer accounts) in a hierarchical database and answers queries against it. Sign-ins are checked against this database by the Kerberos protocol: after one sign-in, no computer in the domain asks for the password again.

What a domain consists of

The AD logical model is a set of nested containers, independent of the physical network. At the top is the forest: the shared directory rules and search across the whole organisation. Inside a forest are domains, where accounts and their passwords live. Domains in the same forest are joined by two-way transitive trusts. Inside a domain are organizational units (OUs), where an administrator groups objects for policies and delegation.

The physical model is machines and the network. A domain controller (DC) is a server with the AD DS role that holds its own copy of the domain database and handles user sign-ins. The copies are replicated between controllers, so the failure of one does not stop the network. A site is a group of subnets with fast links: clients use a controller in their own site, and replication between sites runs on a schedule.

The dashed line is database replication between controllers; the opposite arrows are the two-way trust between domains.

What a domain gives you

With a domain account, an employee signs in to any machine in the fleet with one password: Kerberos issues tickets both for the sign-in and for access to a file server or printer. The administrator manages the fleet from one place. Rules are set by group policy: a policy is linked to an OU, and its settings apply to the computers and users inside it. Besides policies, you can delegate permissions in an OU: let someone reset the passwords of their own department without granting rights over the whole domain.

powershellWindows PowerShell on the client
Add-Computer -DomainName example.com -Restart
LevelWhat it containsWhy it matters
ForestSchema, configuration, global catalogShared rules and search across the whole organisation
DomainAccounts, passwords, domain policiesBoundary for sign-in and replication
Organizational unit (OU)Users, computers, groups, other OUsGroup policy and delegation
SiteSubnets with fast linksClients use the nearest controller

When you need AD and when you do not

AD DS is created for a fleet of Windows computers: it provides single sign-on, group policy and centralised accounts. A domain is not built from a few Linux servers, which have their own access mechanisms. If a company needs a cloud directory without its own controllers, Microsoft offers Microsoft Entra ID, a cloud identity management service; a detailed comparison is beyond the scope of this reference.

What to know first

  • The “TCP/IP and DNS” reference: IP addressing and name resolution. AD DS relies on DNS: controllers and clients find each other through DNS records.
  • The “Virtualisation” reference: a domain controller is often deployed in a virtual machine, so the basics of VMs will help.

Section sources

the section is written from these pages

Cheat sheet

Most everyday domain administration tasks come down to a PowerShell command from the ActiveDirectory module. The commands below are grouped by topic: roles, remoting, users and groups, computers and organizational units (OUs), group policy, DNS, diagnostics and deletion. Replace the names in the examples (dc01, example.local, a.ivanov) with your own.

The ActiveDirectory, GroupPolicy and DnsServer cmdlets work both on a domain controller and on an ordinary workstation, provided Remote Server Administration Tools (RSAT) are installed. Server roles are installed by the ServerManager module, which is part of Windows Server; on a workstation it comes with the RSAT Server Manager component.

powershellas administrator
Add-WindowsCapability -Online `  -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
powershellon the server: the AD DS role with management tools
Install-WindowsFeature -Name AD-Domain-Services `  -IncludeManagementTools

Server and roles

TaskCommand
Install a role or featureInstall-WindowsFeature -Name AD-Domain-Services
Install a role with all its subfeaturesInstall-WindowsFeature -Name Web-Server -IncludeAllSubFeature
Install a role with management toolsInstall-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
List roles and show what is installedGet-WindowsFeature
List available roles by wildcardGet-WindowsFeature -Name AD-*

Remoting

TaskCommand
Open an interactive session on a serverEnter-PSSession -ComputerName dc01
Run a command on a server without a sessionInvoke-Command -ComputerName dc01 -ScriptBlock { hostname }
Install a role on another serverInstall-WindowsFeature -Name DNS -ComputerName dc02
Domain controller serviceInvoke-Command -ComputerName dc01 -ScriptBlock { Get-Service kdc }
Check that a port is reachable on a serverTest-NetConnection -ComputerName dc01 -Port 389

Users and groups

The password for New-ADUser is passed as a secure string. Without a password the account is created disabled, so set the password first and then enable the account with Enable-ADAccount.

powershellthe password goes in a secure string
$password = Read-Host -AsSecureString
powershellcreate a user
New-ADUser -Name 'Anna Ivanova' `  -SamAccountName a.ivanov `  -UserPrincipalName a.ivanov@example.local `  -AccountPassword $password -Enabled $true
TaskCommand
Find a userGet-ADUser -Identity a.ivanov
Filter usersGet-ADUser -Filter 'Name -like "*iv*"'
Show all properties of a userGet-ADUser -Identity a.ivanov -Properties *
List users in an OUGet-ADUser -Filter * -SearchBase 'OU=Sales,DC=example,DC=local'
Change a passwordSet-ADAccountPassword -Identity a.ivanov -Reset
Enable or disable an accountEnable-ADAccount -Identity a.ivanov
Find accounts locked out by failed sign-insSearch-ADAccount -LockedOut
Create a groupNew-ADGroup -Name Sales -GroupScope Global -GroupCategory Security
Add a member to a groupAdd-ADGroupMember -Identity Sales -Members a.ivanov
List the members of a groupGet-ADGroupMember -Identity Sales

Computers and organizational units

TaskCommand
Create an OUNew-ADOrganizationalUnit -Name Sales -Path 'DC=example,DC=local'
Create a computer accountNew-ADComputer -Name srv01 -Path 'OU=Servers,DC=example,DC=local'
Find a computerGet-ADComputer -Filter 'Name -like "srv*"'
Move an object to another OUMove-ADObject -Identity 'CN=srv01,OU=Old,DC=example,DC=local' -TargetPath 'OU=Servers,DC=example,DC=local'
Domain controllersGet-ADDomainController -Filter *

Group policy

TaskCommand
Refresh policies on a machinegpupdate /force
Show which policies were appliedgpresult /r
Policy report as HTMLgpresult /h report.html
List Group Policy ObjectsGet-GPO -All
Back up all Group Policy ObjectsBackup-GPO -All -Path C:\GpoBackups

DNS

TaskCommand
Zones on a DNS serverGet-DnsServerZone -ComputerName dc01
Records in a zoneGet-DnsServerResourceRecord -ZoneName example.local
Add an A recordAdd-DnsServerResourceRecordA -ZoneName example.local -Name srv01 -IPv4Address 192.0.2.10
Resolve a name through DNSResolve-DnsName -Name dc01 -DnsOnly

Diagnostics

TaskCommand
Full domain controller checkdcdiag /s:dc01 /v
Check all domain controllers in the AD sitedcdiag /a
Replication errorsGet-ADReplicationFailure -Target dc01
Directory Service logGet-WinEvent -LogName 'Directory Service' -MaxEvents 50
Latest errors in the System logGet-WinEvent -FilterHashtable @{LogName='System'; Level=2} -MaxEvents 20

Deleting objects

TaskCommand
Preview what would be deletedGet-ADUser -Identity a.ivanov | Remove-ADUser -WhatIf
Delete a userRemove-ADUser -Identity a.ivanov
Delete an empty OURemove-ADOrganizationalUnit -Identity 'OU=Old,DC=example,DC=local'
Remove protection from accidental deletionSet-ADOrganizationalUnit -Identity 'OU=Old,DC=example,DC=local' -ProtectedFromAccidentalDeletion $false
Delete an OU with its contentsRemove-ADOrganizationalUnit -Identity 'OU=Old,DC=example,DC=local' -Recursive

Section sources

the section is written from these pages

Installation and first start

Windows Server is installed from installation media: you choose the Standard or Datacenter edition and an installation option. For a domain controller, choose Server Core and give the server a static IP address and DNS settings before installing the AD DS role.

Standard and Datacenter editions

The editions differ in licensing and features; both include the AD DS, DNS and DHCP roles. Standard licenses two virtual machines (operating system environments, OSEs); Datacenter licenses an unlimited number.

FeatureStandardDatacenter
Virtual machines (OSEs)2Unlimited
Storage Spaces DirectNoYes
Storage ReplicaYesYes
Network ControllerNoYes
Host Guardian Hyper-V SupportNoYes
AD DS, DNS and DHCP rolesYesYes

Standard is enough for a first domain controller and a small infrastructure. Datacenter is for hypervisors running dozens of virtual machines and for software-defined storage.

Hardware requirements

Minimum according to the documentation: a 64-bit 1.4 GHz processor with NX, DEP, SSE4.2 and POPCNT support; 2 GB of memory (4 GB is recommended for the Desktop Experience option); a disk of at least 32 GB; a 1 Gbps Ethernet adapter. A physical server needs ECC (error-correcting) memory.

Server Core or Desktop Experience

Server Core is a minimal installation option without a desktop: fewer components, a smaller attack surface and fewer reboots for updates. You manage it with the command line, PowerShell and remote tools. Desktop Experience is the full option with a desktop and local graphical tools.

Server Core supports almost all server roles, including AD DS, DNS and DHCP. Server Core is recommended for a domain controller: local sign-in to a controller is rarely needed, and a desktop only enlarges the attack surface. The choice is fixed at installation: after installation you cannot switch from Server Core to Desktop Experience or back.

Windows Admin Center, a browser-based tool that you install on a separate machine or gateway and connect to servers over the network, can manage both options remotely.

Installing from media

Write the installation ISO to a USB flash drive of at least 8 GB (on FAT32, an install.wim larger than 4 GB has to be split into install.swm parts; it is more common to format the drive as NTFS) or to a dual-layer 8.5 GB DVD. In the BIOS, change the boot order so that the flash drive comes first, insert the media and restart.

  1. Choose the language, time format and keyboard layout.
  2. Click “Install now”.
  3. Enter the product key or choose pay-as-you-go billing through an Azure subscription.
  4. Choose the edition and installation option: Standard or Datacenter, Server Core or Desktop Experience.
  5. Accept the licence agreement.
  6. Choose “Custom: Install Windows only”.
  7. Select an empty disk and wait for the installation to finish.
  8. Set the password of the built-in Administrator account.

After the reboots, Server Core setup shows only a sign-in window, while Desktop Experience shows the familiar desktop with the initial configuration wizard.

Initial configuration with SConfig

On Server Core, the Server Configuration tool (SConfig) opens right after you sign in as administrator. It is a text menu that gathers the initial configuration in one place. The same tool runs on Desktop Experience with the sconfig command in PowerShell.

OptionWhat it configures
1domain or workgroup
2computer name
3local administrator
4remote management and ping response
5update mode: A, D or M
6searching for and installing updates
7Remote Desktop
8IP address, mask, gateway and DNS
13restarting the server

Renaming the computer and joining a domain take effect after a restart, and SConfig offers to restart the server itself. Joining a domain succeeds only when the server can already resolve the domain controller’s name through DNS.

Static IP and DNS for a domain controller

Give a domain controller a static address: the domain’s DNS records are tied to the address, and a DHCP address changes from time to time and breaks the controller’s registration. In SConfig this is option 8: in the adapter settings, choose S for a fixed address, mask and gateway, then sub-option 2 for DNS addresses.

PowerShell does the same configuration. It remains the main shell of Server Core, and SConfig covers only part of the menu. Use the adapter names and addresses from your own network:

powershellServer Core, PowerShell
Get-NetAdapterNew-NetIPAddress -InterfaceAlias Ethernet `  -IPAddress 192.0.2.11 -PrefixLength 24 `  -DefaultGateway 192.0.2.1Set-DnsClientServerAddress -InterfaceAlias Ethernet `  -ServerAddresses 192.0.2.11, 203.0.113.53

For a future domain controller, set its own address as the first DNS server: the DNS Server service will appear together with the AD DS role and will register the domain’s records at this address. The second is an external or upstream server, for example 203.0.113.53.

Verifying the installation

The Get-ComputerInfo command in PowerShell shows the version and build. In Windows PowerShell, the OsName property contains the OS name with the edition, and OsBuildNumber holds the build number, 26100 for Windows Server 2025. On Desktop Experience, the winver window shows the same.

powershellServer Core, PowerShell
Get-ComputerInfo -Property Os*
textsample output
OsName                  : Microsoft Windows Server 2025 StandardOsBuildNumber           : 26100OsVersion               : 10.0.26100

slmgr /xpr and slmgr /dli show the activation state and the key; you install and activate a key through SConfig option 11. Next, you assign the domain controller role to the server, as described in the “Domain controllers, replication and FSMO” section.

Section sources

the section is written from these pages

PowerShell for administrators

You manage Windows servers from PowerShell, locally or remotely through Windows Remote Management (WinRM) sessions. Commands are cmdlets that return objects. Windows ships with PowerShell 5.1, and the modern PowerShell 7 is installed alongside it. The AD modules come from Remote Server Administration Tools (RSAT).

Windows PowerShell 5.1 and PowerShell 7

Windows PowerShell 5.1 is built into Windows and runs on .NET Framework; older scripts and modules need it. PowerShell 7 is a cross-platform shell built on open-source .NET. It has its own installer and runs side by side with 5.1 without replacing it. The executables differ: powershell for 5.1 and pwsh for 7.

FeatureWindows PowerShell 5.1PowerShell 7
Executablepowershellpwsh
Based on.NET Frameworkmodern .NET
PlatformsWindows onlyWindows, Linux, macOS
Deliverybuilt into Windowsseparate installation
Updatesas part of Windowson its own and through Microsoft Update

Use PowerShell 7 for everyday work and new scripts: errors are shown concisely by default and Get-Error shows them in detail, Export-Csv does not need -NoTypeInformation, and ForEach-Object -Parallel runs blocks in parallel. For modules that need the full .NET Framework, the compatibility mechanism helps: Import-Module -UseWindowsPowerShell runs them in the background through Windows PowerShell 5.1. A complex legacy script is easier to leave on 5.1 than to port.

Cmdlets and the pipeline

Cmdlets follow a Verb-Noun naming scheme: Get-ADUser reads, New-ADUser creates, Set-ADUser modifies. Get-Command shows what a module contains, Get-Help gives help with examples, and its -Online parameter opens the online version. In PowerShell 7, the Update-Help command updates the help files.

powershellcmdlets in the AD module
Get-Command -Module ActiveDirectory -Noun ADUser
powershellhelp with examples
Get-Help New-ADUser -Examples

The shell accepts and returns .NET objects, so the pipeline passes objects between commands rather than text: properties are available immediately, with no string parsing. A typical chain is to get objects, filter with Where-Object, pick fields with Select-Object and save with Export-Csv. The example below selects the disabled accounts in an OU.

powershellon a controller or with RSAT
Get-ADUser -Filter * -SearchBase 'OU=Staff,DC=corp,DC=example,DC=com' |  Where-Object Enabled -EQ $false |  Select-Object Name, SamAccountName |  Export-Csv .\disabled.csv -NoTypeInformation

Where-Object has two forms: a simplified one with a property name and an operator (-EQ, -Like, -GT), and a classic one with a script block, Where-Object {$_.Enabled -eq $false}. Both work in PowerShell 7 and in 5.1.

RSAT on a workstation

The modules for managing a domain (ActiveDirectory, GroupPolicy, DnsServer) are part of Remote Server Administration Tools (RSAT). On Windows Server they are installed with Install-WindowsFeature; on a Windows 10/11 Pro or Enterprise workstation they are a Features on Demand component:

powershellon a workstation, as administrator
# show the state of the featureGet-WindowsCapability -Online |  Where-Object Name -like 'Rsat.ActiveDirectory*'# install the AD DS toolsAdd-WindowsCapability -Online `  -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0

After installation, Get-ADUser, New-ADUser and the other cmdlets are available in the same session. The module is imported automatically on first use, or explicitly with Import-Module ActiveDirectory. The cmdlets contact the domain controller over the network; the machine is already in the domain and finds its controllers through DNS.

Remote sessions over WinRM

PowerShell remoting uses the WS-Management protocol, which the WinRM service carries. On Windows Server, accepting remote commands is enabled by default; on client Windows, run Enable-PSRemoting once as administrator.

consoleinteractive session dialogue
PS C:\> Enter-PSSession -ComputerName dc01[dc01]: PS C:\> hostnamedc01[dc01]: PS C:\> exitPS C:\>

Enter-PSSession opens an interactive session with one machine: the prompt changes to [dc01], commands run on the server, and you leave with Exit-PSSession or exit. To run one command on many machines, use Invoke-Command:

powershellon a workstation
Invoke-Command -ComputerName dc01, dc02 `  -ScriptBlock { Get-Service Netlogon }

The responses are collected into one table with a PSComputerName column, which shows which machine each result came from. The -FilePath parameter runs a script from your own disk on the same machines, and New-PSSession opens persistent sessions: variables created in a session live until it is closed, so data from one command can be used in another.

Some Windows PowerShell cmdlets (Restart-Computer, Test-Connection, Get-HotFix) support -ComputerName without PowerShell sessions, using their own protocols. PowerShell 7 removed it from the service cmdlets (Get-Service, Set-Service); there, the general way to reach a remote machine is Invoke-Command.

Besides WinRM, PowerShell 7 sessions can also run over SSH: in Windows Server 2025 the OpenSSH Server component is already installed, so just enable the sshd service.

Execution policy

The execution policy decides which scripts PowerShell will run. Without a configured policy, Windows Server uses RemoteSigned: local scripts run, while scripts downloaded from the internet run only if signed by a trusted publisher. Client Windows uses Restricted, which runs no scripts. The policy is not a security boundary but a safeguard against accidental runs: you can bypass it by pasting the script’s contents straight into the command line.

powershellview and change
Get-ExecutionPolicy -ListSet-ExecutionPolicy -ExecutionPolicy RemoteSigned `  -Scope CurrentUser

The policy is set by scope, from group policy (MachinePolicy, UserPolicy) down to the machine and the current user. A scope set by group policy cannot be changed, and Set-ExecutionPolicy returns an error. Among the others, in order of precedence, are Process, CurrentUser and LocalMachine: a narrower scope overrides a wider one.

Ready-made commands for common tasks are collected in the “Cheat sheet” section. Account management is covered in “Users, groups and computers”, and policies in “Group policy”.

Section sources

the section is written from these pages

Domains, forests and functional levels

A forest is a set of Active Directory domains that share a schema and a global catalog; a domain is the boundary for accounts and network sign-in. The AD DS role and the Install-ADDSForest command create a new forest: they set up the first domain controller and DNS, and define the functional levels, which are the set of directory features available.

The split is simple. The forest describes how an organisation’s directories relate to each other, domains mark where administrator rights and passwords end, and organizational units (OUs) arrange objects into folders inside a domain. For how this hierarchy is built, see the section “What Windows Server and AD are”.

Creating a forest

You create a forest on the first server that will become a domain controller (DC). Install-WindowsFeature installs the role. No restart is needed afterwards, because the server restarts itself at the end of promotion.

powershellon the future domain controller
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Then the Install-ADDSForest cmdlet promotes the server to a domain controller and creates the forest root domain. You need local administrator rights on the server, since the forest is new and has no domain groups yet. The domain name is a full DNS name, not a single-label one: corp.example.com, not corp. The promotion wizard rejects single-label names, and the name of an internal forest should not repeat the organisation’s external DNS domain.

powershellon the future domain controller
$creds = Get-CredentialInstall-ADDSForest `  -DomainName corp.example.com `  -DomainNetbiosName CORP `  -SafeModeAdministratorPassword $creds.Password

The DSRM (Directory Services Restore Mode) password is the only password the cmdlet strictly requires: it is needed to enter restore mode on every domain controller. If you omit -SafeModeAdministratorPassword, the cmdlet prompts for it with confirmation. Knowing this password means being able to sign in to a controller bypassing the directory, so keep it like a key to the domain. By default the cmdlet also installs a DNS server with a zone for the new domain (-InstallDns is on for a forest), and restarts the server afterwards, which completes the promotion.

Before the real installation, run the prerequisite checks with the Test-ADDSForestInstallation cmdlet and the same arguments. It changes nothing and only reports what would block promotion.

The DSRM password is requested at the Install-ADDSForest step.

After the restart, sign in to the domain as CORP\Administrator. The first controller holds all the FSMO roles (see the section “Domain controllers, replication and FSMO”), the directory database in %SYSTEMROOT%\NTDS and SYSVOL in %SYSTEMROOT%\SYSVOL.

Functional levels

A functional level determines which AD DS features are available and which Windows Server versions can run as domain controllers. It does not affect clients or member servers: any Windows machine can join a domain of any level.

LevelDomain controllers can runWhat it provides
Windows Server 2025Windows Server 2025 onlyoptional 32k pages database feature
Windows Server 2016Windows Server 2016–2025PAM with MIM, NTLM secret rotation
Windows Server 2012 R2Windows Server 2012 R2–2022Protected Users, authentication policies

There are two levels: forest and domain. The domain level is never lower than the forest level, but it can be higher. For a new forest you set both at creation with the -ForestMode and -DomainMode parameters; the highest value is the Windows Server 2025 level. Windows Server 2019 and 2022 have no values of their own: their maximum is WinThreshold, the Windows Server 2016 level.

The documentation advises choosing the highest level your environment allows, so that you do not have to raise it later. You can raise a level at any time. You can also lower it, as long as no feature tied to the current level, such as the Active Directory Recycle Bin, is enabled. Set-ADForestMode raises the forest level (for 2025, Windows2025Forest) and Set-ADDomainMode raises the domain level (Windows2025Domain).

Child domains and trees

Install-ADDSDomain creates a new domain in an existing forest and needs Enterprise Admins rights. By default the domain becomes a child: the -NewDomainName parameter takes a single label that is appended to the parent’s name, so child gives child.corp.example.com. With -DomainType TreeDomain the cmdlet creates the root of a new tree with a full name, which is how one forest holds domains with different suffixes.

powershellon the new domain controller
$creds = Get-CredentialInstall-ADDSDomain `  -NewDomainName branch `  -ParentDomainName corp.example.com `  -Credential $creds

Domains in one forest trust each other automatically: creating a child domain sets up a two-way transitive trust between it and its parent, and the authentication path runs through neighbouring domains. A forest trust between two forests is created manually. It connects the root domains and makes the resources of all domains in both forests available, but does not extend to a third forest. For more on groups, see the section “Users, groups and computers”.

Organizational units: structure for management

An OU is a container inside a domain that holds users, groups, computers and other OUs. A poor structure copies the org chart, with a unit for every department; a working one groups objects by how they are managed. The classic skeleton has three top-level OUs, Users, Computers and Servers, and below them OUs by task, such as Workstations or Terminal Servers.

Two things attach to an OU: Group Policy and delegation. A policy applies to all objects nested in the OU, so a Terminal Servers OU with one policy beats a list of servers in a filter. Delegation gives a group rights over its own part of the directory: the right to reset one department’s passwords is not a right over the whole domain. Objects not placed in an OU sit in the default containers, such as CN=Users, and OU policies do not apply to them.

powershellon the domain controller
New-ADOrganizationalUnit -Name Servers `  -Path 'DC=corp,DC=example,DC=com'New-ADOrganizationalUnit -Name Workstations `  -Path 'DC=corp,DC=example,DC=com'

A new OU is protected from accidental deletion by default (ProtectedFromAccidentalDeletion): you can delete it only after clearing the flag. Keep nesting shallow: every level of policy filtering needs its own OU level, and beyond three or four levels the structure becomes hard to follow.

Section sources

the section is written from these pages

Domain controllers, replication and FSMO

A domain controller (DC) is a server with the Active Directory Domain Services role that stores a copy of the directory and authenticates user sign-ins. Keep at least two controllers in a domain: while one is being repaired, the other serves the network. The copies converge on their own through replication.

Controllers are equal, and each one can write to the directory; this is called a multi-master model. A change made on one controller spreads to the others, and the topology of these paths is built on each controller by the Knowledge Consistency Checker (KCC). The administrator describes only the sites and the links between them.

At least two controllers

With a single controller, its failure means downtime: users cannot sign in to the domain and applications cannot find the directory. A second controller holds a copy of the directory and takes requests while the first is repaired. You add it on a server that has already joined the domain: Install-WindowsFeature installs the role (see the section “Installation and first start”), and Install-ADDSDomainController promotes the server to a controller.

powershellon the new server
$creds = Get-Credential CORP\AdministratorInstall-ADDSDomainController `  -DomainName corp.example.com `  -InstallDns `  -SiteName Tashkent `  -Credential $creds

The cmdlet asks for the DSRM password, installs a DNS server (-InstallDns; without the parameter it is installed if the domain zone is already stored in AD) and makes the new controller a global catalog (GC) server; the -NoGlobalCatalog flag opts out. The global catalog holds every object in the forest, but only a subset of each object’s attributes, the ones searched most often. It serves forest-wide searches and checks universal group membership at sign-in. In a small forest, make every controller a global catalog; for DNS on a controller, see the section “DNS in Active Directory”.

Sites and replication

A site is a group of subnets with fast, reliable connectivity, usually an office or a data centre. A controller is placed in a site by its IP address: AD subnets are mapped to sites, so -SiteName Tashkent is optional if the subnet is already defined. Within a site, KCC connects controllers in a bidirectional ring with extra shortcut links. Between sites, it builds spanning trees over site links, which have a cost and a schedule.

Bridgehead servers chosen by KCC replicate between sites.
FeatureWithin a siteBetween sites
Links between controllersbidirectional ring with shortcut linksspanning trees over site links
Who builds themKCC, with no administrator inputKCC, based on site links
What you configurenothingsite link cost and schedule

Based on the site link, KCC chooses which controllers, called bridgehead servers, replicate between sites. If a partner is unavailable, KCC builds temporary links to other controllers, so replication survives the failure of a single node. For a branch office with a weak connection there is the read-only domain controller (RODC): it receives the directory through replication but cannot be written to, and passwords are replicated only for permitted accounts.

FSMO roles

Replication is multi-master, but not every change is safe to accept on any controller, so a few tasks are assigned to a single owner: a Flexible Single Master Operations (FSMO) role. There are five roles: two for the whole forest and three for each domain. One controller can hold all five; before the forest grows, spread them across different servers.

RoleScopeResponsibility
Schema Masterforest, onethe only controller that can change the directory schema
Domain Naming Masterforest, oneadds and removes domains in the forest
RID Masterdomain, oneallocates RID pools to controllers, from which the SIDs of new objects are built
PDC Emulatordomain, onedomain time source; handles password changes and account lockouts
Infrastructure Masterdomain, oneupdates SIDs and names in references to objects of other domains

The Infrastructure Master should not sit on a global catalog server as long as the domain has a controller that is not one: a forest-wide copy on a global catalog leaves the master with no reference updates to do. If every controller is a global catalog, or the Active Directory Recycle Bin is enabled, the placement of the role does not matter.

The Get-ADDomain cmdlet shows the role owners for the three domain roles, and Get-ADForest shows the two forest roles.

powershellon a domain computer
Get-ADDomain | Select-Object PDCEmulator,  RIDMaster, InfrastructureMasterGet-ADForest | Select-Object SchemaMaster,  DomainNamingMaster

You move a role with the Move-ADDirectoryServerOperationMasterRole cmdlet; the -Identity parameter names the controller that receives the role. Do this transfer while the old owner is running: it is a planned operation.

powershellmoving roles to dc2
Move-ADDirectoryServerOperationMasterRole `  -Identity dc2 `  -OperationMasterRole PDCEmulator, RIDMaster

The PDC Emulator keeps time

The PDC Emulator is the domain’s time source: the other controllers and machines synchronise their clocks down the domain hierarchy, and the PDC Emulator of the forest root domain takes its time from an external source. Kerberos is sensitive to clock skew, so when sign-in behaves strangely, check the time on the controllers first.

Section sources

the section is written from these pages

Users, groups and computers

Users, groups and computers are the three kinds of security principal in a domain: they are how the directory knows who is connecting and what they are allowed to do. Rights are granted not to people but to security groups: a person joins a group, and the group is given access to a resource.

Create a user

The New-ADUser cmdlet creates a user. Only -Name is required, but a working account needs a password and must be enabled: without -Enabled $true the account is created disabled. Pass the password as a SecureString. Read-Host -AsSecureString prompts for it, shows asterisks instead of characters, and leaves it out of both the console history and the script file.

powershellon a domain controller or with RSAT
$pass = Read-Host -AsSecureString 'Password'New-ADUser -Name 'Aigul Tyumeneva' `  -SamAccountName a.tyumeneva `  -UserPrincipalName a.tyumeneva@corp.example.com `  -AccountPassword $pass `  -ChangePasswordAtLogon $true `  -Enabled $true

Add the other properties with parameters of the same cmdlet: -GivenName and -Surname for the first and last name, -Department, -Title and -OfficePhone for the profile fields, and -Path for the organizational unit that will hold the account (for how domains and OUs are built, see the section “Domains, forests and functional levels”). You can add properties to an existing user at any time with Set-ADUser.

powershell
Set-ADUser -Identity a.tyumeneva `  -Department 'Technical support' `  -Title 'Second-line engineer'

Disable-ADAccount disables an account, for example when someone leaves; it works on users, computers and service accounts alike. If a colleague has mistyped their password too many times and the domain has locked them out, Unlock-ADAccount unlocks the account.

powershell
Disable-ADAccount -Identity a.tyumenevaUnlock-ADAccount -Identity a.tyumeneva

Group types and scopes

AD has two types of group. A security group takes part in access checks: you add it to access control lists and grant it rights to resources, and you can also send email to it. A distribution group can only be used for email, and has no place in access lists.

A security group also has a scope: whose accounts it can collect and where it applies. Combining type and scope gives the AGDLP nesting pattern: put accounts (A) into global groups (G), put those into domain local groups (DL), and grant the permissions (P) on the resource to the domain local groups. That way you change rights by changing membership of one group, not by editing every resource.

ScopeMembersWhere it applies
Globalusers and groups from its own domainany domain in the forest, and trusted domains and forests
Domain Localaccounts and global groups from any domain, including trusted ones; universal groups from the forest; domain local groups from its own domainits own domain only
Universalaccounts and groups from any domain in the forestany domain in the forest and trusting forests

The New-ADGroup cmdlet creates a group. -GroupCategory sets the type (Security or Distribution) and -GroupScope sets the scope. Add-ADGroupMember adds members, one at a time or as a comma-separated list.

powershell
New-ADGroup -Name 'Global access' `  -GroupCategory Security -GroupScope Global `  -Path 'OU=Groups,DC=corp,DC=example,DC=com'Add-ADGroupMember -Identity 'Global access' `  -Members a.tyumeneva,i.petrov

Built-in groups

When a domain is created, AD sets up a number of built-in groups. They live in the Builtin and Users containers and already carry rights, from Backup Operators to Domain Admins. The most dangerous are the administrator groups: Domain Admins has full control of its domain, and Enterprise Admins (in the forest root domain only) can change the whole forest, for example by adding domains. Only people who genuinely maintain the domain should belong to these groups. The official recommendation is to keep their membership to a minimum, and an ordinary user should never be in any of them, even temporarily or as a stand-in.

Even a domain owner should use an ordinary account for daily work and enable the administrative one only for tasks on domain controllers. Members of such groups are protected: a background process on the controller periodically overwrites their security descriptors with the values from the AdminSDHolder object, so permissions loosened by hand do not survive the next run.

Join a computer to a domain

When a computer joins a domain, it gets an account of its own, named after the machine with a dollar sign at the end. The domain needs it to authenticate the computer itself: at user sign-in, when applying policies and when the machine accesses resources. New accounts land in the Computers container by default; the -OUPath parameter places them in the right OU straight away.

powershellon the machine being joined
Add-Computer -DomainName corp.example.com `  -Credential CORP\admin-tyumeneva `  -OUPath 'OU=Workstations,DC=corp,DC=example,DC=com' `  -Restart

Run the Add-Computer cmdlet locally on the machine being joined. It creates the machine’s account in the domain if there is not one yet, and -Restart restarts the machine to finish the join. You add such an account to groups just like users: Add-ADGroupMember accepts computers too.

Create users from a file

The Import-Csv cmdlet reads a list of employees from a CSV file row by row and passes it down the pipeline to New-ADUser: each row of the file becomes a new account, and the column headings match the parameter names.

csvusers.csv
Name,SamAccountName,DepartmentAigul Tyumeneva,a.tyumeneva,SupportIgor Petrov,i.petrov,Development
powershellon a domain controller or with RSAT
Import-Csv .\users.csv | ForEach-Object {  New-ADUser -Name $_.Name `    -SamAccountName $_.SamAccountName `    -Department $_.Department `    -Path 'OU=Employees,DC=corp,DC=example,DC=com' `    -AccountPassword (Read-Host -AsSecureString `      ('Password for ' + $_.SamAccountName)) `    -Enabled $true}

Protect objects from deletion

Every new organizational unit is created with protection from accidental deletion turned on. While it is on, the directory refuses to delete the object together with its children, so you must clear the protection first. Since Remove-ADObject with the -Recursive flag erases an OU with all its contents, keep the protection on for users and groups too; the Set-ADObject cmdlet sets it on any object.

powershell
New-ADOrganizationalUnit -Name 'Employees' `  -Path 'DC=corp,DC=example,DC=com'Set-ADObject -Identity 'OU=Employees,DC=corp,DC=example,DC=com' `  -ProtectedFromAccidentalDeletion $true

Section sources

the section is written from these pages

Group Policy

Group Policy is the mechanism for configuring Windows centrally. An administrator defines rules in a Group Policy Object (GPO), and domain computers and users receive them automatically at sign-in and on refresh.

A single GPO holds computer settings and user settings. You link a GPO to a site, a domain or an organizational unit (OU); for how these containers are built, see the section “Domains, forests and functional levels”. An object in a container receives the settings of every GPO linked to it.

Order of processing

Containers form a chain from the local machine down to a nested OU, and policy is applied along it from top to bottom (local, site, domain, OU, or LSDOU). Each later level overrides the previous one: when settings conflict, the container closest to the object wins.

On the left is the normal order of processing; the dashed line is the Enforced bypass.

Inheritance flows downwards: a domain GPO applies to all its OUs unless something is turned off. Block inheritance on a domain or OU stops settings from higher levels from flowing below it. The Enforced flag on a GPO link works the other way: such a GPO overrides the settings of lower levels, and blocked inheritance does not stop it.

Several GPOs can be linked to one container. Link order decides which setting survives: the lower number is applied last and wins, because GPOs with higher numbers are processed first.

Filtering: who does not need the policy

A link hands the policy to the whole container, but you can narrow the scope. Security filtering works at the level of the whole GPO. You add the group you want to the apply list and remove “Authenticated Users” from it, leaving the group with read permission on the GPO. A WMI filter is a query against Windows Management Instrumentation: the GPO applies only if the query returns true, for example on machines with a particular OS version. A GPO can have only one WMI filter, and the client evaluates the filter each time it processes the policy.

Settings inside a GPO fall into two halves: Computer Configuration and User Configuration. The first is applied when the machine starts and affects everyone who works on it: firewall, updates, startup scripts. The second is applied at user sign-in: the Start menu, folder redirection. If you do not need one half, disable it in the GPO: the client skips the empty half and processes the policy faster.

Creating and linking a GPO

The cmdlets of the GroupPolicy module are installed with RSAT, which includes the GPMC and the PowerShell cmdlets. New-GPO names a new GPO, and by default it is linked to nothing: first the object, then the link. New-GPLink links it to a site, domain or OU by the container’s LDAP name; the cmdlets can be chained in a pipeline.

powershellon a domain controller
New-GPO -Name 'Lock screen' `  -Comment 'Lock timeout, security decision from 2026-09' |  New-GPLink -Target 'ou=Workstations,dc=example,dc=local'

A link has three switches: whether it is enabled (-LinkEnabled), whether it is enforced (-Enforced) and its position in link order (-Order). A link is enabled by default; enforcement is off.

Set-GPRegistryValue edits the registry from PowerShell: under Computer Configuration it writes to HKLM, and under User Configuration to HKCU.

powershellon a domain controller
$params = @{    Name      = 'Lock screen'    Key       = 'HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop'    ValueName = 'ScreenSaveTimeOut'    Value     = '900'    Type      = 'String'}Set-GPRegistryValue @params

In day-to-day work you more often edit a GPO in the Group Policy Management Console, which opens the settings editor and shows links together with WMI filters. Use PowerShell for bulk operations and backups.

Refresh and diagnostics on the client

Policy is applied when the computer starts and the user signs in, then refreshed in the background. Clients and servers check for changes every 90 minutes, with a random offset of up to 30 minutes. Domain controllers check computer policy every 5 minutes. You do not have to wait: gpupdate /force reapplies all settings immediately, and gpresult shows what was actually applied.

powershellon the client
gpupdate /forcegpresult /rgpresult /scope computer /h report.html

gpresult /r prints a summary: which groups and OUs the object belongs to and which GPOs were applied. The /h switch saves a full report with setting values as HTML; open it in a browser and search for the setting you need. For a computer, specify /scope computer: its report is generated with administrator rights on that machine.

Policies and preferences

The GPO editor has two trees of settings: Policies, which are the policies proper, and Preferences (Group Policy preferences). Both write to the registry, but they differ in strength. A policy prevents the user from changing the value and may not show it at all. A preference merely writes a value: the user can change a network drive, a shortcut or a home page, and their choice stays until the next policy refresh.

FeaturePoliciesPreferences
What it doeswrites a value to the dedicated policy keyswrites an ordinary registry value, or files, drives and tasks
User can change the valueno, the interface is locked by the policyyes, until the next refresh
On conflictpolicy is stronger than preferenceyields to policy
Removed when the GPO no longer appliesyesno, unless you enable removal in the item itself
Filtering inside a GPOby group and WMI for the whole GPOalso item-level targeting on each item

Preferences are processed by their own client-side extensions: items run from top to bottom, and each item can carry targeting conditions, such as group, computer name, OU or the presence of a battery. Use a policy for what is mandatory or prohibited, and a preference for one-off settings and for creating objects.

Central store for templates

Administrative templates are .admx files that describe registry-based policies and .adml files that hold the interface translations. Without a central store, the editor shows only the templates of the machine it runs on, so the latest Windows 11 settings are not visible on an old controller. The store is the PolicyDefinitions directory in the domain’s SYSVOL, for example \\example.local\SYSVOL\example.local\Policies\PolicyDefinitions. The tools read it by default, and replication distributes the files to the controllers.

powershellon a domain controller, once
Copy-Item `  -Path 'C:\Windows\PolicyDefinitions\*' `  -Recurse `  -Destination '\\example.local\SYSVOL\example.local\Policies\PolicyDefinitions'

Take the files from a reference machine’s C:\Windows\PolicyDefinitions or from a downloaded Microsoft template package. Keep the store identical on all controllers; otherwise the editor shows different sets of settings on different machines.

Section sources

the section is written from these pages

DNS in Active Directory

Active Directory finds domain controllers through DNS: without it, neither sign-in nor the domain works. That is why the DNS server is installed together with AD DS, and zones are stored in the directory rather than in files.

When a server is promoted to a domain controller, the DNS Server role is installed automatically. It publishes the SRV records that clients and other controllers use to find LDAP, Kerberos and the global catalogue. DNS record types and format are covered in the TCP/IP and DNS reference, in the section “DNS records”; here DNS is treated as domain infrastructure.

How a client finds a domain controller

The Net Logon service on each controller registers its SRV and A records in DNS: the controller announces itself, and the client queries DNS. The classic record is _ldap._tcp.dc._msdcs.corp.example.com, which lists the domain’s controllers; _ldap._tcp.gc._msdcs.corp.example.com lists the forest’s global catalogue servers. Records are updated through secure dynamic updates, which verify the computer account.

There are two steps. The client queries the domain’s SRV records and receives a list of controllers with priorities and weights, then contacts them and settles on one that responds. Each controller also registers records for its own site, such as _ldap._tcp.Tashkent._sites.dc._msdcs.…, so clients usually reach a controller in their own site.

powershellon a domain computer
Resolve-DnsName -Type SRV `  -Name _ldap._tcp.dc._msdcs.corp.example.comResolve-DnsName -Type SRV `  -Name _ldap._tcp.gc._msdcs.corp.example.com

If the SRV records disappear or the wrong servers answer, domain sign-in and directory lookups break at once. Resolve-DnsName shows exactly what the client sees. For sites and replication, see the section “Domain controllers, replication and FSMO”.

AD DS-integrated zones

An Active Directory-integrated (AD-integrated) zone is stored in the directory rather than in a file and is replicated along with it. You can edit it on any controller that has the DNS role, not only on the holder of the primary copy. No separate topology is needed for DNS: records travel with directory replication, over the same links and on the same schedule.

Replication scopeWhere the zone is copiedWhen to choose it
Forestto all DNS servers on the forest’s domain controllers (ForestDnsZones partition)shared zones such as _msdcs and internal domain names
Domainto all DNS servers on the domain’s controllers (DomainDnsZones partition)the default; the zone is needed only by its own domain
Legacyto all domain controllers in the domain, even without the DNS rolecompatibility with Windows 2000
Customto DNS servers in a named directory partitionpart of the forest should see the zone and the rest should not
powershellon a domain controller
Add-DnsServerPrimaryZone -Name corp.example.com `  -ReplicationScope Domain -DynamicUpdate SecureAdd-DnsServerPrimaryZone -NetworkID 10.1.0.0/24 `  -ReplicationScope Forest

The first command creates the domain’s primary zone; the second creates a reverse zone for the 10.1.0.0/24 network: Add-DnsServerPrimaryZone with -NetworkID builds the name 0.1.10.in-addr.arpa itself. Get-DnsServerZone lists the zones and their properties.

powershelllist the zones
Get-DnsServerZone | Format-Table ZoneName,  ZoneType, IsDsIntegrated, IsReverseLookupZone
text
ZoneName              ZoneType IsDsIntegrated IsReverseLookupZone--------              -------- -------------- --------------------corp.example.com      Primary  True           False0.1.10.in-addr.arpa   Primary  True           True

Dynamic updates are built into the zone: clients register their own A records when they receive an address and update them when it changes. AD-integrated zones support the strictest mode, secure updates only, which verifies the computer or user account; the -DynamicUpdate Secure parameter sets it. Secure updates are available only in AD-integrated zones. File-based zones offer only unauthenticated updates or none at all, so they are not used for a domain.

Forwarding and reverse zones

A DNS server answers for its own zones itself and resolves other names by recursion from the root. To avoid exposing every server to the internet, queries for external names are first sent to a designated server, a forwarder.

powershellon each DNS server
Set-DnsServerForwarder -IPAddress 203.0.113.53 `  -UseRootHint $false

The server waits five seconds for a reply from the first forwarder, then tries the next. After the list is exhausted it resolves the name itself by recursion from the root, unless -UseRootHint $false has disabled that. For specific names, configure a conditional forwarder: a separate zone listing the addresses of the relevant servers, for example those of a neighbouring company or another forest with its own DNS servers. Conditional forwarders are stored as zones and are replicated too.

powershellconditional forwarder
Add-DnsServerConditionalForwarderZone `  -Name partner.example.org `  -MasterServers 198.51.100.53 `  -ReplicationScope Forest

A reverse zone (in-addr.arpa) answers the question “what is the name of this address?”. PTR records are created in it together with A records during dynamic updates, and the -CreatePtr switch of Add-DnsServerResourceRecordA adds a pointer manually. Create the reverse zone for the network in advance, using the command with -NetworkID.

powershellA record with PTR
Add-DnsServerResourceRecordA -ZoneName corp.example.com `  -Name web -IPv4Address 10.1.0.30 -CreatePtr

Cleaning up stale records

Dynamic registration accumulates clutter: records for decommissioned machines stay in the zone forever. Scavenging removes records that have not been refreshed for a long time, but only when three conditions hold: scavenging is enabled on both the server and the zone, the zone is running, and the records have timestamps. The first command enables scavenging on the server; the second enables aging on the zone.

powershellenable scavenging
Set-DnsServerScavenging -ScavengingState $trueSet-DnsServerZoneAging -Name corp.example.com `  -Aging $true -ScavengeServers 192.0.2.11Start-DnsServerScavenging

-ScavengeServers restricts scavenging to the chosen servers; the other replicas leave the zone alone. Until scavenging is enabled on both the server and the zone, Start-DnsServerScavenging finishes with no result: the conditions are not met.

Section sources

the section is written from these pages

File services and shares

A share is a directory on a file server that clients reach over the SMB protocol through a path such as \\fs1\docs. Permissions are set twice, on the share itself and in the NTFS file system, and the stricter of the two applies. In a domain, grant permissions to Active Directory groups rather than to individual users.

Your first share

The file server role is already built into Windows Server and needs no separate installation. Create a directory on a separate volume, grant NTFS permissions, and publish the directory as an SMB share with the New-SmbShare cmdlet from the SmbShare module.

powershellon the file server
New-Item -Path 'D:\Shares\Docs' -ItemType DirectoryNew-SmbShare -Name Docs -Path 'D:\Shares\Docs' `  -Description 'Development team' `  -FolderEnumerationMode AccessBased

New-SmbShare publishes the directory to SMB clients. Grant-SmbShareAccess sets share permissions: the levels Read, Change and Full correspond to read, read and write, and full control. Then grant permissions on the file system directory with the Get-Acl and Set-Acl cmdlets, again to domain groups rather than to users.

powershellon the file server
Grant-SmbShareAccess -Name Docs `  -AccountName 'CORP\Dev_R' -AccessRight Change -Force$acl = Get-Acl 'D:\Shares\Docs'$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(  'CORP\Dev_R', 'Modify', 'ContainerInherit,ObjectInherit',  'None', 'Allow')$acl.AddAccessRule($rule)Set-Acl 'D:\Shares\Docs' $acl

Share permissions and NTFS permissions

When a user opens a file, Windows combines both permission levels and takes the stricter one: Read on the share with Write in NTFS gives read-only access, and the other way round. Divide the roles sensibly. Keep the share open, with Read for all domain users and Full for the file server’s administrators, and define who can make changes in NTFS.

Three habits worth adopting:

  • One group per share: permissions are granted to a group such as CORP\Docs_RW, and people join and leave the group without any change to permissions on the disk.
  • Disable inheritance from the volume root in NTFS, otherwise permissions from D:\ will flow down to the data folder.
  • Enable access-based enumeration, which is off by default: the share then shows only what the user has access to.
LevelShare (SMB)NTFS
ReadReadRead & Execute
Read and writeChangeModify
Full controlFullFull Control

SMB signing and encryption

SMB signing adds a checksum, computed with the session key, to every packet, so tampering and relay attacks are detected. In Windows Server 2025, signing is required by default for all outbound connections, so connecting to a third-party server or NAS that does not support signing will fail. Enable signing on that device or update it, rather than turning off the requirement on your side. Encryption (-EncryptData $true on the share) protects traffic against eavesdropping between hosts; for domain scenarios, signing is usually enough.

SMB over QUIC

SMB over QUIC wraps SMB in a TLS 1.3 tunnel over UDP 443 instead of TCP 445, making the file server reachable from the internet without a VPN. The feature is available in every edition of Windows Server 2025 and in Windows Server 2022 Datacenter: Azure Edition, and is off by default. The file server needs a certificate from a trusted CA, and the client connects as usual, since TCP remains the default transport.

powershellon the file server
$cert = Get-ChildItem Cert:\LocalMachine\My |  Where-Object {$_.Subject -Match 'fs1'}New-SmbServerCertificateMapping `  -Name fs1.corp.example.com `  -Thumbprint $cert.Thumbprint -StoreName My

A single namespace: DFS Namespaces

When shares are scattered across several servers, users need a single path. DFS Namespaces groups shares into a virtual tree with a root such as \\corp.example.com\files. Folders inside it point to shares on different servers, and the client receives a referral to a target in its own AD site. Host the root of a domain-based namespace on several servers; its metadata lives in AD.

powershellon the namespace server
Install-WindowsFeature FS-DFS-Namespace, RSAT-DFS-Mgmt-ConNew-DfsnRoot -Path '\\corp.example.com\files' `  -TargetPath '\\fs1\docs' -Type DomainV2New-DfsnFolder -Path '\\corp.example.com\files\software' `  -TargetPath '\\fs2\software'

Paths inside the namespace are redirected to the real shares: a client opens \\corp.example.com\files\software and lands on \\fs2\software without knowing it. Moving a share to another server means changing the folder target, not visiting every user. Copying data between targets is done by DFS Replication, the replication service from the same DFS suite.

Do not enable SMBv1

All current versions of Windows talk to each other over SMB 2.x and 3.x. Version 3.1.1 appeared in Windows Server 2016 and Windows 10 and works with earlier 3.x versions by negotiating a common dialect when the connection is set up. SMB 2.x appeared in Windows Vista and Windows Server 2008, so SMBv1 is needed only by older systems.

Section sources

the section is written from these pages

Domain security

Domains are broken through credentials. Having gained rights on a single workstation, an attacker extracts administrators’ passwords and tickets from it and moves deeper into the network. Defence consists of least privilege and administrative tiers, rotation of local passwords, protection of the credentials themselves, and a restore from backup that has been rehearsed.

Least privilege

The highest privileges in the directory are held by three built-in groups: Enterprise Admins, Domain Admins and Administrators. A member of any of them can make themselves a member of the other two, so the groups carry equal risk. In day-to-day operation they should be empty, apart perhaps from the protected built-in Administrator. Ordinary tasks are handled by dedicated groups with delegated permissions (see the section “Users, groups and computers”), and people are added to the highest-privilege groups only for the duration of a task.

powershellon a controller or with RSAT
# check who holds the highest privilegesGet-ADGroupMember -Identity 'Domain Admins'Get-ADGroupMember -Identity 'Enterprise Admins'

Administration needs a separate account, and nobody reads email or opens a browser with it. Every high-privilege sign-in leaves credentials on the machine where it happened, and Domain Admins is by default a member of the local Administrators group on every domain machine. So on workstations and member servers, deny this group sign-in with the Deny log on locally and Deny access to this computer from the network rights (see the section “Group Policy”).

Administrative tiers

The tier model divides the infrastructure into three trust levels. Tier 0 is the domain controllers and everything that manages them: backup, updates, monitoring. Tier 1 is member servers and server applications, and Tier 2 is workstations and user accounts. The rule is simple: credentials from a higher tier are never entered on machines in a lower one, otherwise the weakest computer gets hold of a directory administrator’s password.

TierWhat belongs to itWho administers it
Tier 0domain controllers and everything that manages themdirectory administrators
Tier 1member servers and applicationsserver administrators
Tier 2workstations and accountshelpdesk

Administration is done from dedicated privileged access workstations (PAWs) with no email, browser or office software; the rights of a PAW’s owner match the tier of the systems it serves. A gateway used to sign in to domain controllers inherits their tier, so it is Tier 0 as well. Keep the number of people with organisation-wide Domain Admins rights as small as possible: each such sign-in is a tier 0 credential.

Local administrator passwords

Windows LAPS (Local Administrator Password Solution) automatically changes the local administrator password on every machine and stores it in Active Directory or Microsoft Entra ID. Without LAPS, the same password lives on every machine: stolen on one workstation, it opens all the others. With LAPS, each machine gets its own password and rotates it according to policy, and only those who have been granted the right can read it.

powershellwith RSAT or on a controller
# one-time directory preparationUpdate-LapsADSchemaSet-LapsADComputerSelfPermission -Identity 'DC=corp,DC=example,DC=com'Set-LapsADReadPasswordPermission -Identity 'DC=corp,DC=example,DC=com' `  -AllowedPrincipals @('CORP\LapsReaders')

The policy is defined by a Group Policy Object (GPO) under “Computer Configuration → Policies → Administrative Templates → System → LAPS”. BackupDirectory = 2 stores the password in Active Directory; PasswordAgeDays and PasswordLength set the rotation, by default 30 days and 14 characters; and ADPasswordEncryptionEnabled encrypts the stored password, which only those named by ADPasswordEncryptionPrincipal can decrypt (by default, Domain Admins). Encryption requires a domain functional level of 2016 or higher (see the section “Domains, forests and functional levels”). ADBackupDSRMPassword sends the controllers’ DSRM password to the directory.

powershellfirst command with RSAT or from a controller
# the machine’s password from the directoryGet-LapsADPassword -Identity wks12 -AsPlainText# rotate immediately, on the machine itselfReset-LapsPassword

Credential protection

The Protected Users group disables the most vulnerable authentication mechanisms for its members: NTLM is refused, Kerberos works only with AES (DES and RC4 are prohibited), the Kerberos ticket-granting ticket (TGT) lives no longer than four hours, and devices keep no cached sign-in data for offline use. The group works at a domain functional level of 2012 R2 or higher, and only people’s accounts are added to it.

powershellon a controller or with RSAT
# start with a single pilot userAdd-ADGroupMember -Identity 'Protected Users' `  -Members m.saidova

Credential Guard isolates NTLM hashes, Kerberos tickets and application credentials in a virtualisation-based protected environment, so code running with administrator rights on the machine can no longer extract them. In Windows Server 2025 it is enabled by default on domain-joined machines with suitable hardware; domain controllers are not covered by this default.

Legacy protocols

Legacy protocols are shut down in two steps: audit first, then block. NTLMv1 has been removed starting with Windows Server 2025, and applications are moved from NTLM to Kerberos through Negotiate. SMBv1 has not been installed at all since Windows Server 2019, and SMB signing for outbound connections is now required by default; devices without it are updated or replaced. For LDAP, enable LDAP signing and channel binding: the controller will then accept only signed connections and reject simple binds without encryption.

Before blocking anything, see who else still connects the old way. Once a day the controller writes event 2887 to the log, reporting how many unsigned LDAP binds and simple binds without SSL/TLS occurred; event 2889 records each such bind with the client’s address (it appears after the 16 LDAP Interface Events diagnostics setting is set to 2); and events 3074 and 3075 relate to channel binding.

powershellon a controller, as administrator
Set-SmbServerConfiguration -EnableSMB1Protocol $false
powershellcontroller log: events 2887 and 2889
Get-WinEvent -FilterHashtable @{LogName='Directory Service';  Id=2887,2889} -MaxEvents 20

Backup and forest recovery

Forest recovery begins long before an incident. Regularly take a full server backup (bare metal recovery) of the controllers in each domain; such a backup can be restored onto different hardware and a different copy of the OS. Rehearse the recovery plan at least once a year and after every change to Enterprise Admins and Domain Admins. Keep passwords separately: you will need the Administrator account password of each domain and the DSRM password.

powershellon a controller, as administrator
wbadmin start backup -allCritical `  -backuptarget:E:

If a compromise is suspected, recovery takes place on an isolated network: first one controller of the forest root domain, then the rest. Administrative account passwords are reset before new controllers are connected, and the krbtgt password is reset twice with a pause between: its history keeps the two most recent values, and you wait 10 hours between resets, which is how long a Kerberos ticket lives by default (Maximum lifetime for user ticket).

Bad and good

Most of the measures on the list can be checked with the commands from the earlier blocks:

BadGood
one local administrator password on all machinesWindows LAPS: each machine has its own password, which is rotated
Get-ADGroupMember 'Domain Admins' returns half a pagethe group has one or two members, and only for the duration of a task
a tier 0 sign-in on a workstationtier 0 credentials live only on a PAW
LDAP runs unsigned: “it works as it is”signing is enabled, and clients were found through auditing
a controller backup taken “at some point”wbadmin -allCritical on a schedule and an annual rehearsal

Section sources

the section is written from these pages

Common errors and diagnostics

Diagnose a domain as a chain: client DNS, the SRV record, controller health with dcdiag, replication, the event log. Work through it from the top down: the next check makes sense only once the previous one passes.

Most domain complaints (“the computer won’t sign in”, “the password doesn’t work”, “policies aren’t applied”) start with the client failing to find a controller. Below are the typical symptoms: what to check and with which command.

The order is the same for sign-in and for policies: without DNS, the controller cannot be found.

In short: transport and addresses first, then the directory. On the client, start with the network and DNS addresses; on the controller, start with dcdiag. Look at replication once the controllers themselves are healthy: an object was created on one but did not appear on another.

The client cannot find a controller

A client finds a controller through SRV records: it asks the DNS server from its settings for _ldap._tcp.dc._msdcs.<домен> and receives a list of controllers (see the section “DNS in Active Directory”). Check which DNS addresses the client has:

powershellon the client
Get-DnsClientServerAddress -AddressFamily IPv4

The first DNS address on a domain machine must be a domain controller. If it points to a router or an external server, the client will ask it for SRV records, get no answer and fail to find a controller, even though the network is fully working. Fix the address with Set-DnsClientServerAddress (see the section “Installation and first start”). Then check that the domain’s SRV record responds:

powershellon the client
Resolve-DnsName -Type SRV `  -Name _ldap._tcp.dc._msdcs.corp.example.comGet-ADDomainController -Discover

The first command shows the domain’s SRV records; the second shows which controller the client is choosing right now. If the records are missing, re-register them on the controller: ipconfig /registerdns restores the host’s A record, and restarting the Netlogon service rewrites the SRV records. For a detailed check of the controller:

powershellon a domain controller
dcdiag /v /f:dcdiag.txt

dcdiag is included in Windows Server and in RSAT, and runs with administrator rights. By default it checks whether the controller is in DNS, responds to ICMP pings, and accepts LDAP and RPC connections. The /f: switch redirects all output to a file. A separate run of the DNS test is also useful:

powershellon a domain controller
dcdiag /test:DNS /v /f:dns.txt

Controllers do not replicate

Replication depends on the network, name resolution, authentication and accurate time, and a fault in any of them produces replication errors. repadmin /showrepl shows the state of inbound replication: the time of the last successful and last failed attempt for each partner:

powershellon a controller with RSAT
repadmin /showrepl * /csv | ConvertFrom-Csv | Out-GridView

The Get-ADReplicationFailure cmdlet collects the latest failure on each controller. The -Target parameter names a controller, site, domain or forest, and -Scope narrows the scope: Server, Site, Domain or Forest:

powershellon a computer with RSAT
Get-ADReplicationFailure -Target corp.example.com `  -Scope Domain | Sort-Object LastFailureTime

Look up the last error code in Microsoft’s reference of common replication errors, using the status from the failure column. To check connectivity for a specific pair of controllers, use the CheckSecurityError test. The /ReplSource parameter names the source controller, and dcdiag checks clock skew, permissions on directory partitions, and access to the SYSVOL and NETLOGON shares:

powershellon controller dc1
dcdiag /test:CheckSecurityError `  /ReplSource:dc2

The Directory Service log on the controller and the DNS server log complete the picture: an event names the partner and the reason for the failure.

Policies are not applied

The gpresult /h report shows what the computer and user actually received: the HTML file lists applied and denied policy objects, with the reason for each denial. A report for the current user:

powershellon the client
gpresult /h report.html

The /r switch prints a summary straight to the console, and /v adds detail. A policy is not applied if the machine is in the wrong organizational unit or the object is not linked to it (see the section “Group Policy”); the report shows the link as well. Next, look at filtering and the LSDOU order of application: local policy, then site, domain and organizational units from the top down to nested ones, with the object of the last unit winning.

Kerberos error caused by clock skew

Kerberos tolerates a difference of no more than five minutes between the client’s and the controller’s clocks. With a larger skew, sign-in and services fail and replication stops. w32tm shows the state of the time service:

powershellon the client
w32tm /query /status /verbosew32tm /query /source

The first command prints the synchronisation state, including the clock offset; the second shows where the machine gets its time. The /resync parameter forces synchronisation right now; a controller that has lost its source repeats source discovery and synchronisation:

powershellon the client
w32tm /resyncw32tm /resync /rediscover

A computer has lost trust with the domain

Signing in with a domain account stops working, with a message that the trust relationship between the workstation and the domain has failed. The computer account password on the machine and in the domain have diverged (for example, after a virtual machine was rolled back to an old snapshot), and the secure channel is broken. Check and repair the channel with the Test-ComputerSecureChannel cmdlet:

powershellon the client, as administrator
Test-ComputerSecureChannelTest-ComputerSecureChannel -Repair -Credential (Get-Credential)

Without parameters the cmdlet returns True or False; with -Repair it deletes and rebuilds the Netlogon secure channel. This needs administrator rights on the machine, and a domain account with permission to do it is passed through -Credential. If the repair does not help, rejoin the machine to the domain (see the section “Users, groups and computers”). The cmdlet works only on domain members; on controllers themselves it returns false errors, and the controllers’ channel is checked with netdom and nltest.

Where to look next

Event logs collect everything the commands did not show: the Directory Service log on the controller, the DNS server log, and the System log entries from the Net Logon service on the client and the controller. For a puzzling case, have the client log it: nltest /dbflag:0x2000ffff turns on verbose logging of controller discovery, and events are written to the Netlogon.log file in %windir%\Debug.

powershellon the client
nltest /dbflag:0x2000ffff

After fixing the problem, reset the flag with the same command and the value 0x0. If the cause is not found, a network analyser shows the path between the client and the controller by capturing the controller discovery and DNS reply traffic. Check the exact Windows error text against Microsoft’s reference, which lists known replication and controller discovery errors by code: searching with the symptom in your own words gets you to the right page faster.

Section sources

the section is written from these pages

Versions and what’s new

This reference covers Windows Server 2025, the current Long-Term Servicing Channel (LTSC) release, and its directory service, Active Directory Domain Services (AD DS). The latest update is 2026-10 OOB of 26 October 2026, build 26100.33674. LTSC gets 5 years of mainstream and 5 years of extended support: until 13 November 2029 and 14 November 2034.

Channels and support dates

Releases come in two channels: the Long-Term Servicing Channel (LTSC), with a long lifecycle, and the Annual Channel (AC), a yearly channel for containers and microservices. Install domain controllers on LTSC: these releases receive security and quality updates for their whole lifetime. The last AC release is version 23H2, and it is not intended for domain controllers.

ReleaseChannelMainstream support untilExtended support until
Windows Server 2025LTSC13 November 202914 November 2034
Windows Server 2022LTSCupdates ended14 October 2031
Windows Server 2019LTSCupdates ended9 January 2029
Windows Server 2016LTSBupdates ended12 January 2027

The 2022, 2019 and 2016 releases are in the extended phase: mainstream support has ended, but security updates continue. Windows Server 2025 Datacenter: Azure Edition follows a hotpatch calendar: every quarter there is a cumulative update that requires a restart, and in the other two months a hotpatch that does not.

What’s new in 2025 for AD DS

Domains and forests now have a separate 2025 functional level (DomainLevel 10 and ForestLevel 10 for unattended installation). It is required for the database with 32k pages and applies only when all domain controllers in the forest run Windows Server 2025. For details, see the section “Domains, forests and functional levels”.

  • 32k-page database: since 2000 the directory has been stored in the Extensible Storage Engine (ESE) with 8k pages; an optional feature moves it to 32k pages with 64-bit Long Value IDs, so a multivalued attribute can hold about 3,200 values, a 2.6-fold increase. The switch is made for the whole forest; older domain controllers keep the 8k format.
  • LDAP channel binding auditing: events 3074 and 3075 show in advance which devices do not support channel binding, before you switch LDAP policy to a stricter mode.
  • dMSA (delegated Managed Service Account) accounts: the domain controller generates and stores the keys; migrating a service account to a dMSA disables its previous password.
  • Windows LAPS: automatic management of the local account, detection of image rollback through the msLAPS-CurrentPasswordVersion attribute, and passphrases.
  • LDAP: support for TLS 1.3 and signing by default for new deployments; PKINIT in Kerberos gained cryptographic agility, with no hard-coded algorithms.
  • The schema is extended by the files sch89.ldf, sch90.ldf and sch91.ldf; objects that have lost key attributes are repaired with the fixupObjectState operation.
  • Computer account passwords are generated randomly, and a password based on the computer name cannot be set. Name and SID lookups between machine accounts go through Kerberos rather than the Netlogon channel. AD DS uses processors from all NUMA groups.

SMB changes alongside AD: SMB signing is required for all outbound connections, not just SYSVOL and NETLOGON; SMB over QUIC is available in the Standard and Datacenter editions (see the section “File services and file shares”); NTLM can be blocked for SMB.

Deprecated and removed

A deprecated feature is still included and receives security updates, but is no longer developed; a removed feature does not come back. What matters most for AD:

  • NTLMv1 is removed; NTLMv2 works but is no longer developed and will be removed in a future release. Replace NTLM with Negotiate, which authenticates with Kerberos and falls back to NTLM only when necessary.
  • RC4 in Kerberos is deprecated: it is a weak algorithm used to steal credentials, so switch to AES-SHA1. TLS 1.0 and 1.1 are disabled by default, and DES is removed.
  • Windows PowerShell 2.0 has been absent since the September 2025 update.
  • The SMTP server, Internet Explorer and the IIS 6 management console are removed.
  • WMIC and VBScript have moved to Feature on Demand and will be removed; use PowerShell instead of WMIC.
  • WSUS and Windows Internal Database (WID) are no longer developed: WID was used by the AD FS, AD RMS, IPAM, RD Connection Broker and WSUS roles.

Security updates

Every month, in the second week, a cumulative B release comes out with security and quality updates; in the fourth week a D release may follow, a preview set of fixes without security updates. Out-of-band (OOB) updates appear in between when a bug needs a prompt fix. The update history is kept on the release information page, which also lists builds and Knowledge Base article numbers.

A cumulative package contains every fix since the release. To check a controller’s build:

powershellon a domain controller
$p = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'"Build $($p.CurrentBuildNumber).$($p.UBR)"

How to upgrade

An in-place upgrade is not recommended for domain controllers: it is technically possible, but brings neither performance improvements nor new AD features. The recommended path is a clean installation: new domain controllers on Windows Server 2025, a transfer of the FSMO roles (see the section “Domain controllers, replication and FSMO”), and demotion of the old ones. Servers without AD DS can be upgraded in place: up to four versions at a time from 2025, and up to two for 2022 and earlier.

  • Install the AD DS role and promote the new servers to domain controllers: adprep /forestprep and adprep /domainprep run automatically during promotion.
  • The first 2025 controller in a forest needs the schema master, infrastructure master and RID master.
  • Retire the old controllers by demoting them, then raise the functional levels.

Section sources

the section is written from these pages

End of the reference

What changed

revision history · 3 entries

Every edit is saved as a revision: a snapshot of the reference, the reason and a summary of changes. The published version changes only after the same checks as at creation.

  1. Manual edit

    reason: manual edit
  2. Manual edit

    reason: manual edit
  3. Reference updated

Weekly check

How the reference is checked

Once a week — and right after news of a release or a vulnerability — the reference is checked in three steps.

  1. 1. Freshness

    Sections are compared with the release notes and changelogs from the official sources and with the topic’s news.

  2. 2. Errors

    Every section is read again: wrong facts, outdated APIs and flags, broken examples.

  3. 3. Links — by an HTTP request

    Every source link must respond. A broken link is a reason to recheck the section.

No findings — only the date changes. Findings — only the affected sections are rewritten, and they appear in “What changed”. A new version replaces the published one only after passing the same checks as at creation.

Statuses

Verified
no findings
Updated
sections rewritten, edits are listed
Rechecking
while the check runs, the previous version stays open
Needs review
disputed points: the verified version is shown, editors review

Last check

10 Nov · Check · updated · no findings

Found an error in the reference?

On the topic

tracks, news and other references
The whole “Windows Server and AD” topic
12 sections
Another reference · DevOps & cloud

Ansible

Verified 6 Nov
All references · 61