Tuesday, April 13, 2010

Active Directory Health Check Tool

So here's a little gem that will tell you just about everything you never wanted to know about your AD infrastructure. It pipes the results to a .txt file for easy and thorough review, and also gives a very general sense of health by comparing the number of PASSES and FAILS. I strongly recommend reviewing the resultant c:\ad_diag .txt file in detail to get a more accurate perspective of your AD health. Many of the utils don't report in a pass/fail format, so reviewing the output file is a must for the real picture.

Make sure you have the Server Resource tools for your server platform installed:

Windows Server 2003 Resource Kit Tools
Windows 2000 Resource Kit Tools for administrative tasks

You can download the Active Directory Health Check Tool, ready to run as a .bat, here.

Or, for the more cautious, copy and paste the text below into a .txt file, save as .bat.

In either case run it on your FSMO domain controller to get a real good picture of the status with your AD. None of this stuff is intrusive, mostly verbose versions of the command line diags for AD. Enjoy!

@echo off
echo Active Directory Health Diagnostic, v1.1
echo ........................................
echo Running dcdiag /v.....
dcdiag /v >> c:\ad_diag.txt
echo Running dcdiag /test:DNS /DNSALL (may take a few moments, be patient).....
dcdiag /test:DNS /DNSALL /e /v >> c:\ad_diag.txt
echo Running dcdiag /test:DcPromo /e /v.....
dcdiag /test:DcPromo /e /v >> c:\ad_diag.txt
echo Running dcdiag /test:RegisterInDNS.....
dcdiag /test:RegisterInDNS >> c:\ad_diag.txt
echo Running netdiag.exe /v.....
netdiag.exe /v >> c:\ad_diag.txt
echo Running netsh dhcp show server.....
netsh dhcp show server >> c:\ad_diag.txt
echo Running repadmin /showreps.....
repadmin /showreps >> c:\ad_diag.txt
echo Running repadmin /replsum /errorsonly.....
repadmin /replsum /errorsonly >> c:\ad_diag.txt
echo ........................................
echo Diagnostic Completed Successfully...
echo view results in C:\ad_diag.txt
pause
echo ........................................
echo ........................................
echo ........................................
echo General Health Ratio (FAILS/PASSES)
echo THis is very general, be sure to check C:\ad_diag.txt!
echo ........................................
echo NUMBER OF FAILS
find /c /i "fail" c:\ad_diag.txt
echo ........................................
echo NUMBER OF PASSES
find /c /i "pass" c:\ad_diag.txt
pause


No comments:

Post a Comment