Thursday, 28 April 2016

ACTIVE DIRECTORY HEALTH CHECK SCRIPT

Hi, I just want to share a script for AD health check. Usually I run this script to gather the information on each domain controller, and from the data outcome, I will identify and create a health check document. 

Below is the scripts that I use it and I hope everyone can use it also.  InsyaAllah.. You may copy it and paste to the notepad, save it as a batch file (*.bat). If you run it on the domain controller, it will create a folder at path C:\%computername% and all the output data will stored in this folder.


"md c:\%computername%
cd c:\%computername%
whoami >loginacc.txt
systeminfo >sysinfo.txt
netdom query fsmo >fsmo.txt
repadmin /replsum >replsum.txt
repadmin /showrepl >showrepl.txt
repadmin /showreps >showreps.txt
repadmin /queue >queue.txt
dcdiag /v >dcdiagv.txt
dcdiag /test:dns >dnstest.txt
ipconfig /all >ipconfig.txt
net share >netshare.txt
w32tm /query /source >w32tm.txt
end
"


You may download the batch file from this URL https://drive.google.com/file/d/0B4E0ILJDNhMSZHdycE03aXBaWkk/view?usp=sharing