Advertisement
pedronrivera

AD Health Checks Script

Apr 23rd, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.07 KB | None | 0 0
  1. @Echo Off
  2. ECHO Running AD Health Checks - Notepad will open after completion
  3. ECHO You can share this log using http://pastie.org/pastes/new
  4. ECHO This Command Prompt will close after you close Notepad
  5. ECHO http://blog.thesysadmins.co.uk
  6. set logfile=%userprofile%\Desktop\ADHealth.txt
  7. echo You can share this log using http://pastie.org/pastes/new > %logfile%
  8. echo. >> %logfile%
  9. echo. >> %logfile%
  10. REM Finds system boot time
  11. echo System Boot Time ------------------------------------------------------------- >> %logfile%
  12. systeminfo | find "System Boot Time:" >> %logfile%
  13. systeminfo | find "System Up Time:" >> %logfile%
  14. echo. >> %logfile%
  15. echo. >> %logfile%
  16. REM Displays all current TCP/IP network configuration values
  17. echo IPCONFIG ------------------------------------------------------------- >> %logfile%
  18. ipconfig /all >> %logfile%
  19. echo. >> %logfile%
  20. echo. >> %logfile%
  21. REM Analyse the state of domain controllers in a forest and reports any problems to assist in troubleshooting
  22. echo DCDIAG ------------------------------------------------------------- >> %logfile%
  23. dcdiag /a >> %logfile%
  24. echo. >> %logfile%
  25. echo. >> %logfile%
  26. REM The replsummary operation quickly summarizes the replication state and relative health
  27. echo Replsummary ------------------------------------------------------------- >> %logfile%
  28. repadmin /replsummary >> %logfile%
  29. echo. >> %logfile%
  30. echo. >> %logfile%
  31. REM Displays the replication partners for each directory partition on the specified domain controller
  32. echo Showrepl ------------------------------------------------------------- >> %logfile%
  33. repadmin /showrepl >> %logfile%
  34. echo. >> %logfile%
  35. echo. >> %logfile%
  36. REM Query FSMO roles
  37. echo NETDOM Query FSMO ------------------------------------------------------------- >> %logfile%
  38. netdom query fsmo >> %logfile%
  39. REM Query Global Catalogs
  40. echo List Global Catalogs ------------------------------------------------------------- >> %logfile%
  41. for /f "tokens=2" %%a in ('systeminfo ^| findstr Domain:') do set domain=%%a
  42. nslookup -querytype=srv _gc._tcp.%domain% >> %logfile%
  43. notepad %logfile%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement