16.15. Determining the Size of the Active Directory Database

Problem

You want to determine the size of the Active Directory database.

Solution

Using a command-line interface

If you are in DS Restore Mode, you can use ntdsutil to report the size of the Active Directory database:

> ntdsutil files info

If you are not in DS Restore Mode and run this command, you will receive the following error message:

*** Error: Operation only allowed when booted in DS restore mode
        "set SAFEBOOT_OPTION=DSREPAIR" to override - NOT RECOMMENDED!

As you can see, it is possible to override this failure by setting the SAFEBOOT_OPTION environment variable to DSREPAIR, but I do not recommend this unless you know what you are doing. By setting that environment variable, the ntdsutil command will not stop you from performing other commands. This can be very dangerous.

Another method, which is safer and easier, is to bring up a command shell by going to Start Run, typing cmd.exe, and pressing Enter. Then type cd <NTDSDir>, where <NTDSDir> is the full path to the ntds.dit file. Finally, run the dir command; the output will show the size of the files.

Discussion

The size of the Active Directory database on a domain controller is effectively the size of the ntds.dit file. This file can vary slightly in size between domain controllers even within the same domain due to unreplicated changes or differences with nonreplicated data.

You should monitor the size of this file on one or more domain controllers in each domain to ...

Get Active Directory Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.