By default Windows runs an online Defragmentation of the Windows Active Directory database every 12 hours. However, Online defragmentation doesn’t recover the disk space or compact the database. It simply moves data around.
An Offline Defragmentation, on the other hand performs a defragmentation on the database, compacts it and recovers the space. Use the “ntdsutil” utility to run Offline Degramentation on Windows Active Directory. This requires unmounting the Active Directory which mean rebooting the server in “Directory Service Restore mode”.
NOTE: It is important that you take a backup of the Active Directory before performing this operation.
1. Reboot the Windows Server.
2. Press F8 to bring up the Windows Startup menu.
3. Select the ” Directory Services Restore Mode”. This will start Windows Server in Safe Mode and the Directory Service not running
4. Login as a local admin.
5. Now, from the command prompt (Start – Run – type “cmd” and press enter)
6. Run the command ntdsutil.exe
This will launch the ntdsutil
7. Enter “files” at the ntdsutil prompt.
This will launch the file maintenance mode
8. Enter “compact to c:\tmp\”
This will instruct ntdsutil to compact the database to c:\tmp\ folder. This could be any folder. Basically, “ntdsutil” will compact and create a new database leaving the original database file ntds.dit in “%systemroot\ntds\” folder.
9. Replace the original ntds.dit file with the new compacted one.
c:\tmp> copy ntds.dit %systemroot%\ntds\ntds.dit
That completes the process. Reboot the server as normal and check if all is OK. Should there be a problem, be prepared to restore your backup
Incoming search terms:
- ntdsutil defrag (8)
- ntdsutil offline defrag (7)
- windows 2003 server active directory defragmentation (4)
- windows server 2003 offline defragmentation (2)
- windows 7 offline defrag (2)
- offline defrag active directory 2003 (2)
- Ntdsutil repair windows 2012 (1)
- ntdsutil server 2003 (1)
- ntdsutil to compact (1)
- Ntdsutil windows 8 (1)