~/force the kcc (knowledge consistency checker) to run on a domain controller
Clean up stale NTDS connection objects after demoting a domain controller, and make the KCC rebuild the replication topology straight away.
Updated November 2026. Originally written for Windows Server 2008. The commands are unchanged on current Windows Server versions, and I’ve added a few extras.
The problem
After demoting domain controllers, you can be left with stale NTDS connection objects in Active Directory. In my case, a DC at our central site still had a connection object pointing at a remote-site DC that had just been demoted. It needed to point at the new DC at that site instead.
The Knowledge Consistency Checker (KCC) builds the replication topology automatically, but it only runs every 15 minutes. You can make it run immediately.
The fix
- In Active Directory Sites and Services, find the stale connection object under the central DC’s NTDS Settings and delete it.
- On that same DC, force the KCC to run:
repadmin /kcc
This makes the DC check its inbound replication topology straight away and create any missing connections. In my case, a new connection object to the new remote DC appeared immediately.
To run it against a specific DC from elsewhere, or against every DC:
repadmin /kcc DC01
repadmin /kcc *
You can do the same from the GUI: right-click NTDS Settings under the DC, then All Tasks → Check Replication Topology.
Check it worked
repadmin /showrepl
repadmin /replsummary
/showrepl lists the DC’s inbound partners and the last replication result. /replsummary gives a quick health check across the whole forest, and it’s worth running after any DC change.
In PowerShell, you can list the connection objects with:
Get-ADReplicationConnection -Filter * | Select-Object Name, ReplicateFromDirectoryServer, ReplicateToDirectoryServer
Tip
If you’re decommissioning a DC that has failed rather than demoting it cleanly, do a metadata cleanup first. Deleting the computer object in Active Directory Users and Computers or Sites and Services on current Windows Server versions takes care of most of it. Then run repadmin /kcc so the topology rebuilds around the gap.