Active Directory Restore Mode Trick
How does Ntdsutil.exe know it’s in Directory Restore mode?
NTDSUTIL is a tool used for many Active Directory database maintenance tasks, such as defragmenting the DB, moving the DB and/or log files to a different place, cleaning the DB and more.
NTDSUTIL will allow you to perform many of it’s functions while the DC is up and running. However some of the maintenance tasks (such as performing an offline defragmentation of the DB and moving the files to a different location, along with the Authoritive restore commands) require that you start the DC in Directory Restore mode, found when you access the boot menu by pressing F8 before the server starts it’s startup sequence.
When you start the domain controller in Directory Restore mode, the DC sets the environment variable safeboot_option to “dsrepair.”
If, for some reason, you want to access the “protected” features of NTDSUTIL while it is NOT in the Directory Restore mode, you will receive an error similar to this:
C:\WINDOWS>ntdsutil ntdsutil: files *** Error: Operation only allowed when booted in DS restore mode "set SAFEBOOT_OPTION=DSREPAIR" to override - NOT RECOMMENDED! ntdsutil:
If you want to check something in NTDSUTIL that is allowed only in Directory Restore mode, you can “trick” the program by typing the following statement at a command prompt:
Lamer Note: Type the above command into a different CMD window, NOT the one that NTDSUTIL is running in.
Don’t use this approach on a live or important machine because it could result in system damage if you try to perform system modifications when the system isn’t in Directory Restore mode.
More in Active Directory
How to Restore Active Directory
Sep 19, 2022 | Michael Reinders
How to Add a New Domain Controller to an Existing Domain
Sep 12, 2022 | Michael Reinders
How to Back Up Active Directory
Sep 6, 2022 | Michael Reinders
How To Install Active Directory Users And Computers: A Step-by-Step Guide
Aug 12, 2022 | Michael Reinders
Microsoft Launches New On-Premises Unified Update Platform To Manage Windows Updates
Jul 27, 2022 | Rabia Noureen
How to Fix The "Trust Relationship Between This Workstation And The Primary Domain Failed" Error
Jul 27, 2022 | Michael Reinders
Most popular on petri