Search The Site

How To Use The DCDiag Command

Using the dcdiag command. The DCDiag (Domain Controller Diagnostic) tool will analyze the state of the domain controllers and services in an Active Directory (AD) forest. DCDiag is a very good general-purpose testing tool for checking the health of the AD infrastructure. The available tests include replication errors, domain controller connectivity, permissions, proper roles, and connectivity, and other general AD health tests. DCDiag is even capable of running nondomain controller-specific tests like whether a server may be promoted to a domain controller (this is the dcpromo test). It can also register its records properly in DNS using the RegisterInDNS test.

DCDiag is run exclusively on domain controllers, with the only exceptions being the dcpromo and RegisterInDNS tests. When DCDiag is run without any parameters, all the tests are run against the current domain controller, this will run all the main tests and is normally sufficient for most purposes.

Accepted parameters for DCDiag are as follows :

  • /s:DomainController : Specifies using the domain controller as the home server.
  • /n:NamingContext : Specifies using the specified naming context (FQDN, NetBIOS, or distinguished name) to test.
  • /u:Domain\UserName /p:{*|Password|””} : Specifies using the supplied credentials for running the tool.
  • /a : Will test all the domain controllers in the site.
  • /e : Will test all the domain controllers in the enterprise.
  • /q : Shows quiet output (errors only).
  • /v : Shows verbose output.
  • /I : Ignores any minor error messages.
  • /fix : Fixes the minor problems.
  • /f:LogFile : Logs to a defined log file.
  • /ferr:ErrorLogFile : Logs any errors to the log file.
  • /c : Comprehensively runs all the tests.
  • /test:TestName : Runs only specified tests .
  • /skip:TestName : Skips all the specified tests.

When you are specifying tests to run or to skip, note that all nonskippable tests will be run regardless.

DCDiag is automatically included on Windows Server 2008 when the AD DS (Active Directory Domain Services) role is added. Alternatively, on non-domain controllers, the utility may be installed by adding the Remote Server Administration Tools feature from the Server Manager.