Active Directory troubleshooting: dcdiag, repadmin, nltest and lockouts
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
When Active Directory has a problem, it feels like everything is broken at once: logons crawl, drives don’t map and policies don’t apply. Active Directory troubleshooting comes down to a short list of tools that point straight at the part that’s sick.
You’ll run a health check with dcdiag and repadmin, test the secure channel and the DC locator with nltest, read Kerberos tickets and check time sync, trace an account lockout back to where it came from, and watch one change replicate between DCs.
| Time | You need | By the end you can |
|---|---|---|
| About 90 minutes | DC01, DC02, SRV01, NODE1 and CL01 | Check domain health in five minutes and find the cause of logon, lockout and replication problems |
What it is, in one line
Active Directory troubleshooting means checking the five things every logon relies on: DNS, DC health, replication, secure channels, and Kerberos along with time.
In Simple Words
In Simple Words
Think of a school with two offices that keep the same list of students. When a new student joins, one office writes the name down and sends a copy to the other, and if that copy never arrives the second office says “never heard of you”. If the clocks in the two offices don’t agree, a pass stamped at 9:00 looks fake when it’s only 8:50 there. AD goes wrong in much the same ways: a copy that didn’t travel (replication), a pass that doesn’t look right (Kerberos and time), or a student who can’t find the office at all (DNS).
Engineer's View
Engineer’s View
dcdiag: runs dozens of tests against a DC (Advertising, Replications, Services, FrsEvent or DFSREvent, SysVolCheck, KccEvent, DNS), and dcdiag /q shows you only the failures.
repadmin: /replsummary fits replication health on one screen, /showrepl lists each partner with its last error, /syncall /AdeP forces replication, and /showobjmeta tells you which DC changed an attribute and when.
nltest: /dsgetdc: shows which DC and site a machine finds through DNS, /sc_query: checks the computer’s secure channel, and /sc_reset: rebuilds that channel against a DC you choose.
Kerberos and time: klist lists the cached tickets and klist purge clears them. By default Kerberos tolerates 5 minutes of clock difference, so w32tm /query /source and w32tm /stripchart are your next checks. setspn -X finds duplicate SPNs, and a duplicate breaks Kerberos for that service.
Lockouts: the PDC emulator logs event 4740 with the caller computer, and the 4625 or 4771 events on that computer lead you to the process that’s still using the old password.
How it works, step by step
Where an AD problem usually hides:
Start with DNS, because DCs, clients and replication all find each other through SRV records, and if DNS is wrong every other test gives you confusing results.
Next, check DC health and replication. A DC that hasn’t replicated for days will hand users old passwords and miss recent group changes.
Last of all, look at the one machine or account in trouble: its secure channel, its tickets, its clock and its lockout history.
The tool for each question:
In the lab you’ll:
- Run a five-minute health check with dcdiag and repadmin.
- Check the DC locator and secure channel from CL01.
- Look at Kerberos tickets and time sync.
- Lock out an account and trace it to its source.
- Follow one change from DC02 to DC01.
Hands-on lab: check domain health
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01, DC02, SRV01, NODE1 and CL01, and work as SAATLAB\adm.rahul in PowerShell as administrator.
1Run a five-minute health check
On DC01:
dcdiag /s:DC01 /q
dcdiag /s:DC02 /q
repadmin /replsummaryYou’ll see something like this:
Replication Summary Start Time: 2026-10-19 15:10:04
Beginning data collection for replication summary, this may take awhile:
....
Source DSA largest delta fails/total %% error
DC01 08m:41s 0 / 5 0
DC02 06m:12s 0 / 5 0
Destination DSA largest delta fails/total %% error
DC01 06m:12s 0 / 5 0
DC02 08m:41s 0 / 5 0dcdiag /q printed nothing, and that’s what you want, because quiet mode only shows failures. Zero fails in the summary means both DCs are replicating every partition. If you see a large delta (hours or days) or a number in the error column, that’s your first lead.
✅ Checkpoint: dcdiag /q is silent for both DCs and repadmin /replsummary shows 0 fails.
2Check the DC locator and secure channel
On CL01:
nltest /dsgetdc:saatlab.internal
nltest /sc_query:saatlab.internal
Test-ComputerSecureChannelYou’ll see something like this:
DC: \\DC01.saatlab.internal
Address: \\10.0.0.10
Dom Name: saatlab.internal
Our Site Name: HQ
Dc Site Name: HQ
The command completed successfully
Flags: 30 HAS_IP HAS_TIMESERV
Trusted DC Name \\DC01.saatlab.internal
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully
TrueCL01 sits in site HQ and found DC01 in that same site, and the secure channel (the computer account’s trust with the domain) is healthy. If Test-ComputerSecureChannel comes back False, users get “The trust relationship between this workstation and the primary domain failed”.
✅ Checkpoint: nltest finds DC01 in site HQ, the secure channel status is NERR_Success, and Test-ComputerSecureChannel returns True.
3Read Kerberos tickets and check time
On CL01, clear the tickets, open a share, and then list the tickets and the time source:
klist purge
Get-ChildItem \\SRV01\Departments | Out-Null
klist | Select-String 'Server:'
w32tm /query /source
w32tm /stripchart /computer:DC01 /samples:3 /dataonlyYou’ll see something like this:
Server: krbtgt/SAATLAB.INTERNAL @ SAATLAB.INTERNAL
Server: cifs/SRV01 @ SAATLAB.INTERNAL
DC01.saatlab.internal
Tracking DC01 [10.0.0.10:123].
Collecting 3 samples.
The current time is 19/10/2026 15:14:02.
15:14:02, +00.0021433s
15:14:04, +00.0018807s
15:14:06, +00.0020112sYou got a TGT (krbtgt) and a service ticket for cifs/SRV01, so Kerberos is working, and CL01 syncs from DC01 and is only about 2 ms off, well inside the 5-minute limit. If you see only NTLM (no cifs ticket), check the name you used, the SPN and the time.
✅ Checkpoint: klist shows krbtgt and cifs/SRV01 tickets, and the time offset to DC01 is a few milliseconds.
4Lock out an account and trace the source
On CL01, enter a wrong password 11 times (Lesson 19 set the lockout threshold to 10):
1..11 | ForEach-Object { net use \\SRV01\IPC$ /user:SAATLAB\kiran.das WrongPass1 2>$null }
net use \\SRV01\IPC$ /user:SAATLAB\kiran.das WrongPass1You’ll see something like this:
System error 1909 has occurred.
The referenced account is currently locked out and may not be logged on to.On DC01, which is the PDC emulator, find the lockout and who caused it:
(Get-ADDomain).PDCEmulator
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4740 } -MaxEvents 1 | ForEach-Object {
$x = [xml]$_.ToXml()
[pscustomobject]@{
Time = $_.TimeCreated
User = ($x.Event.EventData.Data | Where-Object Name -eq 'TargetUserName').'#text'
Caller = ($x.Event.EventData.Data | Where-Object Name -eq 'TargetDomainName').'#text'
}
}
Search-ADAccount -LockedOut | Select-Object SamAccountNameYou’ll see something like this:
DC01.saatlab.internal
Time User Caller
---- ---- ------
19/10/2026 15:18:40 kiran.das SRV01
SamAccountName
--------------
kiran.dasIn event 4740 the TargetDomainName field holds the caller computer name. Here that’s SRV01, because CL01 authenticated to SRV01 and SRV01 checked the password with the DC, so your next stop is SRV01’s 4625 events, which show CL01 (10.0.0.150) as the source. Keep following the trail until you reach the device or process with the wrong password.
Clear the lockout:
Unlock-ADAccount kiran.das
(Get-ADUser kiran.das -Properties LockedOut).LockedOutYou should see this:
False✅ Checkpoint: Event 4740 named the caller computer, and kiran.das is unlocked.

5Follow one change from DC02 to DC01
On DC01, create a user on DC02, check whether DC01 has it yet, and then force replication:
New-ADUser test.repl -Path 'OU=Staff,OU=SAATLAB,DC=saatlab,DC=internal' -Server DC02
Get-ADUser test.repl -Server DC01
repadmin /syncall DC02 /AdeP | Select-String 'SyncAll terminated'
Get-ADUser test.repl -Server DC01 | Select-Object Name
repadmin /showobjmeta DC01 'CN=test.repl,OU=Staff,OU=SAATLAB,DC=saatlab,DC=internal' | Select-String 'whenCreated'You’ll see something like this:
Get-ADUser : Cannot find an object with identity: 'test.repl' under: 'DC=saatlab,DC=internal'.
SyncAll terminated with no errors.
Name
----
test.repl
1 Branch\DC02 1081736 19/10/2026 15:22:31 1 whenCreatedThe user was on DC02 but not yet on DC01, because replication between sites runs on a schedule (Lesson 31). After the forced sync, /showobjmeta proves the change came from Branch\DC02. When you’ve finished, delete the test user with Remove-ADUser test.repl -Confirm:$false.
✅ Checkpoint: test.repl appeared on DC01 after repadmin /syncall, and showobjmeta shows DC02 as the originating DC.
Break It, Then Fix It
Here are two faults that dcdiag and setspn pick up quickly: a DC that stops advertising itself, and a duplicate SPN.
1Break it: stop Netlogon on DC02
On DC01, stop the Netlogon service on DC02 and then run dcdiag against it:
Invoke-Command -ComputerName DC02 -ScriptBlock { Stop-Service Netlogon }
dcdiag /s:DC02 /test:Advertising /test:ServicesYou’ll see something like this:
Testing server: Branch\DC02
Starting test: Advertising
Warning: DsGetDcName returned information for \\DC01.saatlab.internal, when we were trying to reach
DC02.
SERVER IS NOT RESPONDING or IS NOT CONSIDERED SUITABLE.
......................... DC02 failed test Advertising
Starting test: Services
Invalid service startup type: Netlogon on DC02, current state is Stopped
......................... DC02 failed test Services
Netlogon is the service that registers the DC’s SRV records and answers the “which DC should I use?” requests. While it’s stopped DC02 keeps running, but clients in the Branch site fall back to DC01 over the WAN and their logons slow down.
To fix it, start Netlogon and run the test again:
Invoke-Command -ComputerName DC02 -ScriptBlock { Start-Service Netlogon }
dcdiag /s:DC02 /test:Advertising /test:Services /qQuiet mode prints nothing, which means both tests passed.
✅ Checkpoint: dcdiag failed Advertising and Services while Netlogon was stopped, and is silent after starting it.
2Break it: register a duplicate SPN
On DC01, add the same SPN to two computer accounts (setspn -A doesn’t check for duplicates):
setspn -A HTTP/reports.saatlab.internal SRV01
setspn -A HTTP/reports.saatlab.internal NODE1
setspn -XYou’ll see something like this:
Checking domain DC=saatlab,DC=internal
Processing entry 0
HTTP/reports.saatlab.internal is registered on these accounts:
CN=SRV01,OU=Servers,OU=SAATLAB,DC=saatlab,DC=internal
CN=NODE1,OU=Servers,OU=SAATLAB,DC=saatlab,DC=internal
found 1 group of duplicate SPNs.When a client asks for a ticket for HTTP/reports, the KDC can’t tell which account to encrypt it for, so Kerberos fails and the DC writes KDC event 11 to the System log. Users then fall back to NTLM or keep getting password prompts.
To fix it, take the SPN off the wrong account and check again:
setspn -D HTTP/reports.saatlab.internal NODE1
setspn -D HTTP/reports.saatlab.internal SRV01
setspn -XYou’ll see something like this:
Checking domain DC=saatlab,DC=internal
Processing entry 0
found 0 group of duplicate SPNs.At work you’d leave the SPN on the account that really runs the service. Add SPNs with setspn -S, since it refuses duplicates (Lesson 21).
✅ Checkpoint: setspn -X found one duplicate group, then zero after removing the test SPNs.
This happened at work
The DC that came back from a snapshot
A small company ran two DCs on an old hypervisor. After a patch went wrong, an admin reverted one DC to a snapshot from two weeks earlier, saw it boot fine and moved on to the next job. Over the following days, password changes worked on one DC and not the other, new users appeared and then disappeared, and a few computers lost their trust. The reverted DC had gone back in time but reused its update counter (USN) for new changes, so its partner ignored them, which is what’s called a USN rollback. Event 2095 and a paused Netlogon service had been sitting on that DC the whole time, and nobody looked. In the end they had to forcibly remove the DC, clean up its metadata on the healthy DC and build a new one.
The fix: DC snapshots are now banned unless the hypervisor supports VM-GenerationID, and the team gets a daily repadmin /replsummary report.
The lesson: don’t restore a DC from a snapshot on a platform that doesn’t support it. Use a system state backup to restore AD instead (Lesson 32).
Common mistakes and troubleshooting
| Mistake | What happens | What to do instead |
|---|---|---|
| Checking AD before DNS | Confusing results from every tool | Check client DNS and SRV records first |
| Ignoring replication for days | Old passwords, missing groups, lingering objects | Daily repadmin /replsummary, alert on fails |
| Looking for 4740 on the wrong DC | No lockout events found | Check the PDC emulator |
| Unlocking without finding the source | The account locks again in minutes | Follow caller computer, 4625/4771, then the process |
| Adding SPNs with -A | Duplicates break Kerberos | Use setspn -S; check with setspn -X |
| Fixing time on clients only | Skew returns | Fix the PDC emulator’s time source; others follow the hierarchy |
| Rejoining machines to fix trust | Loses local profile settings and takes time | Try Test-ComputerSecureChannel -Repair first |
| Reverting DC snapshots | USN rollback | System state restore or rebuild the DC |
Interview questions
Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll see why they ask and one way you could answer in your own words.
Fresher level
1. A user calls and says they can’t log on. Where do you start?
Why they ask this: They want to see you have a simple method and rule out the common causes first.
How you might answer: First I ask for the exact error message. Then I check whether the account is locked or disabled and whether the password has expired, and if the account looks fine, I check whether the computer can find a domain controller, which usually comes down to DNS.
2. Can you explain in simple words what dcdiag does?
Why they ask this: They’re checking you know the main health check tool for domain controllers.
How you might answer: dcdiag runs a set of health tests on a domain controller, covering things like whether the DC advertises itself, its services, replication, SYSVOL and DNS. I normally run dcdiag /q so I only see the failures and the problems jump out.
3. How would you check that Active Directory replication is healthy?
Why they ask this: They want to know you’re at home with repadmin, which every AD admin uses.
How you might answer: I start with repadmin /replsummary for a quick look across all the DCs and any failures. If something’s failing, I run repadmin /showrepl on that DC to get the detail and the error for each replication partner.
2–5 years experience
4. A user keeps getting locked out, even after resetting their password. How would you find the source?
Why they ask this: They want to see you can follow a lockout through the logs to the real cause.
How you might answer: I’d find event 4740 on the PDC emulator to get the caller computer, then check the 4625 or 4771 events on that computer. Most of the time it turns out to be a service, a scheduled task, a mapped drive or a phone that’s still using the old password.
5. A user sees “The trust relationship between this workstation and the primary domain failed”. What causes that, and how do you fix it?
Why they ask this: They want to know you understand the computer’s secure channel with the domain.
How you might answer: It means the computer account password has gone out of sync between the machine and AD, which often happens after a VM snapshot revert or when a machine has been offline for a long time. I’d repair it with Test-ComputerSecureChannel -Repair or nltest /sc_reset, so there’s no need to rejoin the domain.
6. A web app works with NTLM, but Kerberos authentication fails. What would you look at?
Why they ask this: They’re checking you understand SPNs, which are behind most Kerberos problems with web apps.
How you might answer: I’d look for a missing or duplicate SPN or the wrong service account, and also check whether users connect with a name that doesn’t match the SPN, or whether there’s time skew. I’d use setspn -Q to find the SPN, setspn -X to find duplicates, and klist on the client to see which tickets it really got.
Senior level
7. What is a USN rollback, and how would you recover a DC that has one?
Why they ask this: They want to see you understand AD internals and know the safe way to recover.
How you might answer: It happens when a DC is restored from an unsupported snapshot and reuses USNs, so its partners think they’ve already seen those changes and ignore them, and event 2095 shows up. To recover, I’d demote the DC, or forcibly remove it if I have to, then do the metadata cleanup and rebuild it.
8. Users in one branch office say logons are slow, but head office is fine. How would you investigate?
Why they ask this: They want to see you think about AD sites and which DC the clients really use.
How you might answer: I’d run nltest /dsgetdc on a branch PC to see which DC it finds, and if it’s a DC in another site, I’d check that the branch subnet is mapped to the right site. I’d also look at the branch DC’s Netlogon service and SRV records, and at the WAN link.
9. How would you keep an eye on AD health across many domain controllers without checking each one by hand?
Why they ask this: They want to see you work proactively and catch problems before users do.
How you might answer: I’d schedule dcdiag and repadmin reports and alert on key events like 2042, 2095 and 1311, plus any spike in 4740 lockouts, along with DNS and time-offset checks. Then I’d put it all on a per-DC dashboard so the team can spot problems at a glance.
Quick quiz
Q1. What does dcdiag /q show?
- Every test
- Only failures
- Only DNS tests
Show answer
B — Silence means healthy.
Q2. Where do you find event 4740?
- Any client
- The PDC emulator
- The DHCP server
Show answer
B — Lockouts are processed there.
Q3. Which tool checks a computer’s secure channel?
- nltest /sc_query
- klist
- w32tm
Show answer
A — Or Test-ComputerSecureChannel.
Q4. Why did DC02 fail the Advertising test?
- DNS was down
- Netlogon was stopped
- Time skew
Show answer
B — Netlogon advertises the DC.
Q5. What caused the problem in the work story?
- A duplicate SPN
- A DC reverted to a snapshot (USN rollback)
- A full disk
Show answer
B — Use system state restores for DCs.
Quick recap
- Active Directory troubleshooting covers DNS, DC health, replication, secure channels, and Kerberos with time.
dcdiag /qplusrepadmin /replsummarygives you a five-minute health check.nltestshows the DC locator result and secure channel status.klist,w32tmandsetspn -Xcover Kerberos problems.- Trace lockouts from event 4740 on the PDC emulator to the caller computer.
- Don’t revert DCs by snapshot unless the platform supports VM-GenerationID.
Next lesson
Lesson 46: Group Policy troubleshooting → Next you’ll work out why a policy doesn’t apply using gpresult, the Group Policy operational log and RSoP, and then fix filtering, link order and slow-link problems.
Further reading: Active Directory troubleshooting
Want to go deeper into Active Directory troubleshooting? Microsoft’s Active Directory troubleshooting guidance covers common problems by area, and the dcdiag reference lists every test. You can also see the full plan for this course on the Windows Server Administration course page.
