This command creates a new compacted copy of ntds.dit in the c:\mydir folder; the system will create the folder if it doesn't already exist. Type
quit
two times to exit the Ntdsutil utility. Replace the current ntds.dit file (using the path you noted above) with the compact version you just created. Delete any log (*.log) files in the active AD database location, as the Ntdsutil utility instructs, and reboot the server.
Although it isn't necessary, regular defragmentation of the AD database on your DCs can help reduce the AD database file size, which in turn can improve directory performance and availability. Because performing an offline defragmentation also provides a degree of database verification (errors will occur during defragmentation if the database is corrupt), it can also serve as a "canary in the coal mine" to alert you to database problems. For additional information about AD defragmentation, see the Microsoft article "Performing Offline Defragmentation of the Active Directory Database" (http://support.microsoft.com/default.aspx?scid=kb;en-us;q232122).
The final article in this series about recovering crucial network services will discuss the "break glass in case of emergency" aspect of AD maintenance: AD repair and recovery procedures and best practices. (For a list of the other articles in the series, see "AD Recovery Resources," page 20.)