Windows Domain Health Checks

January 3rd, 2012 | Posted by Andy in administration | Operating Systems | Server Core | Windows

It’s often necessary to check the health of your Windows Domain and Domain Controllers. You need to know if your domain is healthy before and after routine maintenance – Patching and the like – and when you are trying to diagnose problems.

I’ve had to do this more times than i care to remember, and each time I end up trawling the same sites to recall the same scripts that I run to output the logs that allow me to determine whether everything is OK or not. So this time I decided to compile the individual scripts in to a batch file that will run them all in sequence and output the results to files that I can review for problems. The scripts are thus:

  • Dcdiag.exe /v – shows if there are any problems with your Domain Controllers and their associated services
  • Dcdiag.exe /test:dns  - validates the health of the Domain DNS service and replication.
  • Netsh dhcp show server  - Verifies DHCP servers and names
  • Repadmin /showreps  - Shows the status of replication between domain controllers
  • repadmin /replsum /errorsonly  - shows you any errors in the replication between domain controllers

I’ve inserted these commands into a batch file, together with the switches to output the results of each script to file, rather than display it on screen. All files are created in C:temp – you will need to created this folder first if it doesn’t already exist. There are 2 batch files – one to be run before your maintenance to check for pre-existing problems, and another to run afterwards, to check for problems created as a result of your maintenance. The scripts are identical except for the name of the output files – the pre files are all prefixed pre_ and the post files are all prefixed post_ – so that you can see the before and after versions for comparison.

The batch files are available for download below. You will need to change the file extension of the downloaded files to .bat in order for them to work:

DC Diagnose Pre

DC Diagnose Post

 

 

You can follow any responses to this entry through the RSS 2.0 Both comments and pings are currently closed.