FolderRisk: Do not touch
- Windows Server
NTDS C:\Windows\NTDS
Default folder of ntds.dit, the Active Directory database, and its transaction logs on a domain controller; the location can be changed at promotion.
What it’s for
On a domain controller, C:\Windows\NTDS holds by default the AD DS directory database, ntds.dit, with its transaction logs. The AD DS Configuration Wizard proposes these default locations and you can change them at promotion. The folder only exists once the role is configured. Its neighbor SYSVOL carries Group Policy and scripts, not the directory.
What it contains
ntds.dit: the directory database (users, groups, computers, schema and password hashes).- The transaction logs
edb*.log(the current one isedb.log), the checkpoint fileedb.chkand the reserve filesedbres*.jrs. temp.edband possible temporary maintenance files.- Sometimes none of it: the database or logs may have been placed on another volume at promotion.
Risks and best practices
- The AD DS service keeps the database open all the time. Do not copy, move or delete anything while it runs: tampering can make the controller unusable.
- To relocate the database, use
ntdsutil(thefilesmenu) with the controller restarted in Directory Services Restore Mode, never File Explorer. - Together with the
SYSTEMhive, a copy ofntds.ditis enough to extract the hashes of every account in the domain. Protect backups and restrict access to this folder. - To back up, use a system state backup (or
ntdsutil ifmfor install-from-media), not a file copy. - Keep free space on the volume: logs that can no longer grow stop the directory.
Useful commands
# Configured locations of the database and logs (on a domain controller)Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" | Select-Object "DSA Database file", "Database log files path", "DSA Working Directory"
# File sizes and datesGet-ChildItem "$env:windir\NTDS" -Force | Select-Object Name, Length, LastWriteTime
# System state backup, which includes NTDS and SYSVOL (as administrator; adjust target E:)wbadmin start systemstatebackup -backuptarget:E: -quiet
# Directory file informationntdsutil "activate instance ntds" files info quit quit