JSI Tip 2635. How do I defragment the Active Directory database?

Jerold Schulman

July 24, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

During the Garbage Collection process which occurs every 12 hours, online defragmentation optimizes data storage and reclaims space for new objects, but it does not reduce the size of the Active Directory database (Ntds.dit).

To defrag and compact the Active Directory database:

01. Perform a System State backup.

02. Create a folder to temporarily contain the compacted database (md "Folder").

03. Restart your domain controller in Directory Service Restore mode.

04. Logon with the built in local Administrator account.

05. Open a CMD prompt and type ntdsutil.

06. Type files.

07. Type info to display the current path and size information.

08. Type compact to "Folder".

09. Type quit and quit to return to the CMD prompt.

10. Copy the "Foldertds.dit" file over the original ntds.dit as displayed in step 07.

11. Restart your DC normally.

NOTE: you may remove "Foldertds.dit" after you restart normally.


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like