Fix ERROR_DS_MUST_BE_RUN_ON_DST_DC (0X0000216E) on Windows Server
This error pops up when you try to run an AD operation on the wrong domain controller. The fix depends on whether the source DC is alive or dead. I'll walk you through the three most common causes.
Cause 1: Attempted restore on a non-destination DC (most common)
I know this error is infuriating — you're trying to bring a domain controller back online after a failure, and Windows just throws up the 0X0000216E error with the message “For security reasons, the operation must be run on the destination DC.” The real trigger is almost always this: you initiated a nonauthoritative restore from backup on a DC that wasn't the target of the restore operation.
Let me break that down. When you restore AD from backup on a DC that's still part of the replication topology, the directory service agent (DSA) on that DC checks whether it's the intended destination for the restore. If it sees another DC with a higher USN (update sequence number) — meaning the source is more up-to-date — it refuses to start. You get the error.
The fix: You need to perform the restore on the destination DC directly, not on the source. But if that source DC is dead and gone, there's a workaround.
- Boot the target DC into Directory Services Restore Mode (DSRM). For Windows Server 2016/2019/2022, press F8 during startup and pick Directory Services Restore Mode.
- Restore the AD database from backup using
ntdsutilor your backup software (like Windows Server Backup). - After restore, boot normally. If you still get the error, run the following command from an elevated command prompt:
ntdsutil
activate instance ntds
set DSA to destination dc
quit
quit
That command tells AD that this DC is the destination. I've used this on Server 2019 DCs after a failed hardware swap — it saved me from rebuilding the whole domain.
Cause 2: The source DC is offline and the destination DC can't replicate
This one's trickier. You might get the error even after a clean restore if the source DC's metadata is still in Active Directory. The DSA on the destination DC tries to contact the source for replication metadata, finds nothing, and throws the error.
Real-world scenario: You decommissioned an old Windows Server 2012 R2 DC six months ago, but someone forgot to remove its NTDS Settings from AD Sites and Services. Now you're trying to promote a new Server 2022 DC, and bam — error 0X0000216E.
The fix: Clean up the dead DC's metadata using ADSI Edit or ntdsutil. Here's the ntdsutil route (I prefer it — fewer mouse clicks):
- Open an elevated command prompt.
- Type
ntdsutiland press Enter. - Type
metadata cleanupand press Enter. - Type
connectionsand press Enter. - Type
connect to server <destination_DC_name>— replace with the actual name. - Type
quitto exit the connections menu. - Type
select operation targetand press Enter. - Type
list domains— note the domain index (usually 0). - Type
select domain 0(or the correct index). - Type
list sites— note the site index. - Type
select site <site_index>. - Type
list servers in site— find the dead DC's index. - Type
select server <dead_DC_index>. - Type
remove selected server— confirm the prompt. - Type
quitrepeatedly to exit.
After that, reboot the destination DC. The error should be gone.
Cause 3: Nonauthoritative restore performed on a DC that wasn't the last to replicate
This one tripped me up the first time too. You did a restore on the correct DC, but the backup you used was from a different DC — one that wasn't the last to replicate a critical partition (like the schema or domain partition). AD sees the USN mismatch and blocks the operation.
When it happens: You restore a DC from a backup made on another DC in the same domain. The backup was a week old, and the domain partition has new objects. The destination DC can't reconcile the USN gap and throws error 0X0000216E.
The fix: Do an authoritative restore of the specific partition using ntdsutil. This marks the restored objects as authoritative, forcing other DCs to accept them as the source of truth.
- Boot the destination DC into DSRM.
- Restore the AD database as usual.
- After restore, but before booting normally, open a command prompt.
- Type
ntdsutiland press Enter. - Type
activate instance ntdsand press Enter. - Type
authoritative restoreand press Enter. - Type
restore subtree "DC=domain,DC=com"— replace the DN with your domain's distinguished name. - Type
quittwice to exit. - Reboot normally.
I've used this exact procedure on a Server 2016 DC that had a corrupt copy of the domain partition. After the authoritative restore, replication kicked in and the error never came back.
Pro tip: If you're still stuck, check the event logs under Directory Service for event ID 1926 — it often logs the source DC name that's causing the conflict. Use that name in step 13 of the metadata cleanup.
Quick-reference summary table
| Cause | Symptom | Fix | Tools |
|---|---|---|---|
| Restore on wrong DC | Error appears during DSRM boot | Use set DSA to destination DC in ntdsutil | ntdsutil |
| Dead source DC metadata | Error during replication or promotion | Remove dead DC metadata from AD | ntdsutil metadata cleanup, ADSI Edit |
| Non-authoritative backup from wrong DC | Error after restore, USN mismatch | Perform authoritative restore of partition | ntdsutil authoritative restore |
I've been managing AD since Windows Server 2003, and this error still catches me off guard when I'm in a hurry. The key takeaway: always verify which DC is the destination before you start a restore. If you're unsure, check the dSASignature attribute in ADSI Edit — the destination DC's GUID should match the one in the backup. That extra minute of checking saves you an hour of debugging.
Was this solution helpful?