AD Health Checking


AD Health Checks

As a matter of course, I always start my troubleshooting of any funky network issues with a standard set of Active Directory health checks. This is the blog post I’ve used for a few years now: (http://msmvps.com/blogs/ad/archive/2008/06/03/active-directory-health-checks-for-domain-controllers.aspx)

After doing this several hundred times, I finally got around to writing a batch file to run all of the checks in sequence. Below is the text for the script. Paste this into a .bat, create the ADLogs folder and then change the file location appropriately and you’ll be all set. Good Luck!

========================================================

echo off

REM ###########################################

REM    AD Health Check batch file. This runs standard health

REM    checks in Active Directory and puts the results into

REM    the D:\ADLogs directory.

REM    Written by: Matt Richardson

REM    Last Update: 9/2/2011

REM    Reference: 06/03/2008 Blog post by MSMVP BrianM

REM ###########################################

echo The following AD Health Checks are now running: dcdiag, netdiag, dhcp, and repadmin. Your results can be found in D:\ADLogs.

title AD Health Check Now Running…..

REM The real work begins here

dcdiag /v >> d:\ADLogs\dcdiag.txt

netdiag.exe /v >> d:\adlogs\netdiag.txt

netsh dhcp show server >> d:\adlogs\dhcp.txt

repadmin /showreps >> d:\adlogs\showreps.txt

repadmin /replsum /errorsonly >> d:\adlogs\repadmin_err.txt

title AD Health Check Complete!

echo AD Health Check Complete!

timeout 10

exit

UPDATE for Server 2008

I have updated the script to give a more complete look at the domain with the addition of the /c switch on the dcdiag command, and removed the netdiag command which has been essentially removed from 2008.

echo off

REM ###########################################

REM    AD Health Check batch file. This runs standard health

REM    checks in Active Directory and puts the results into

REM    the c:\ADLogs directory.

REM    Written by: Matt Richardson

REM    Last Update: 1/25/2012

REM    Reference: 06/03/2008 Blog post by MSMVP BrianM

REM ###########################################

echo The following AD Health Checks are now running: dcdiag, dhcp, and repadmin. Your results can be found in c:\ADLogs.

title AD Health Check Now Running…..

REM The real work begins here

dcdiag /c /v >> c:\ADLogs\dcdiag.txt

netsh dhcp show server >> c:\adlogs\dhcp.txt

repadmin /showreps >> c:\adlogs\showreps.txt

repadmin /replsum /errorsonly >> c:\adlogs\repadmin_err.txt

title AD Health Check Complete!

echo AD Health Check Complete!

timeout 10

exit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: