Active Directory Series

💾 The Top 1% Hands-On for Going Beyond the AD Recycle Bin: System State Backup and Authoritative Restore

Introduction

This article is part of the Top 1% Series Complete Article Guide, the 33rd article in the Active Directory Series.

Prerequisites

The Big Picture

This hands-on consists of four steps.

graph LR
    Step1["Step1<br/>Take a System State backup"]
    Step2["Step2<br/>Deliberately make a<br/>serious change"]
    Step3["Step3<br/>Boot into DSRM and perform<br/>a non-authoritative restore"]
    Step4["Step4<br/>Perform an authoritative<br/>restore with ntdsutil"]
    Step1 --> Step2 --> Step3 --> Step4

Hands-On Steps

Step 1: Take a System State backup

Use the Windows Server Backup feature to back up the DC’s System State — the full set of OS configuration information, including the AD DS database.

Install-WindowsFeature Windows-Server-Backup
wbadmin start systemstatebackup -backupTarget:E: -quiet

A System State backup includes not just the AD DS database file (ntds.dit), but the entire set of information a DC needs to function — SYSVOL, the registry, the certificate store, and more. Once the backup finishes, create a test OU called TestOU with a test user inside it.

Step 2: Deliberately make a serious change

To dirty the state after the backup was taken, delete TestOU.

Remove-ADOrganizationalUnit -Identity "OU=TestOU,DC=example,DC=com" -Recursive -Confirm:$false

Here’s the key point. To simulate an environment where the AD Recycle Bin isn’t enabled, or tombstoneLifetime has long since expired, we’ll try restoring from the Step 1 backup this time, without using the AD Recycle Bin at all.

Step 3: Boot into DSRM and perform a non-authoritative restore

Restart the DC, booting it into DSRM (Directory Services Restore Mode).

bcdedit /set safeboot dsrepair
Restart-Computer

Log on with the DSRM administrator password (set when the DC was originally built), and run the restore from your backup.

wbadmin start systemstaterecovery -version:<backup version identifier> -quiet

The restore performed at this point is called a “non-authoritative restore.” It resets the DC to the state at backup time, but once that DC reboots into normal mode, it receives all the changes (via replication) that occurred after the backup from other healthy DCs — and ultimately catches back up to the latest state (which means TestOU ends up deleted again). Simply performing a non-authoritative restore does not, in the end, bring back the TestOU you deleted.

Step 4: Perform an authoritative restore with ntdsutil

To actually bring TestOU back, you need to explicitly mark the restored object as “treat this as newer than any change coming in from any other DC.” That’s what ntdsutil is for. Still in DSRM mode, run the following.

ntdsutil
activate instance ntds
authoritative restore
restore subtree "OU=TestOU,DC=example,DC=com"
quit
quit

Running this deliberately rewrites the target object’s and its child objects’ USN (update sequence number) to a value higher than any other DC holds. Once the DC reboots into normal mode, other DCs see this rewritten USN as “newer than what I already have” and propagate TestOU’s revival, via replication, out to every other DC.

What a Pro Sees Here (Top 1% Understanding)

Why rewriting the USN is the decisive factor in the restore

As covered in Understanding DC Health Checks from a “Top 1%” Perspective and Understanding Sites, AD DS replication fundamentally works on a USN-based mechanism — newer changes overwrite older ones. A non-authoritative restore alone leaves the object at the backup-time USN, which every other healthy DC sees as merely “old information,” and it eventually gets overwritten by replication regardless. What an authoritative restore actually does is deliberately rewrite that USN to a future value, convincing every other DC that “this is the correct, most current state.” Understanding this mechanism is what makes it click why “restoring alone doesn’t bring it back,” and why the special ntdsutil procedure is needed at all.

USN as resistance against a “rollback attack”

Flip this USN-based mechanism around, and it also serves as a defense against a malicious rollback attack — deliberately restoring a DC from an old backup to roll it back to an earlier state (say, one where a departed employee’s account hadn’t yet been disabled). Under an ordinary (non-authoritative) restore, a DC restored with an old USN simply gets pulled back to the correct, current state through replication with other healthy DCs. This property — getting pulled back to the correct state through replication — is a concrete manifestation of the fact that AD DS isn’t a system with a single point of failure, but a distributed system built on consensus among multiple DCs.

Common Misconceptions and Pitfalls

Troubleshooting Perspective

  1. You’ve forgotten the DSRM password and can’t log on: You need to reset it ahead of time, using Domain Admin rights while booted in normal mode, with ntdsutil’s set dsrm password command.
  2. The object still doesn’t come back after running authoritative restore: Check whether the target DN (distinguished name) path is exact, and whether the DC you’re restoring actually has replication partners (this can’t be validated with a single standalone DC).
  3. Taking the backup itself fails: Check whether the Windows-Server-Backup feature is correctly installed, and whether the backup destination has enough disk space.

Summary

Takeaways to Apply Today

  1. Even with the AD Recycle Bin enabled, keep taking regular System State backups separately.
  2. Remember to periodically reset and record the DSRM password.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).