Diagnostiquer Active Directory rapidement

Le diagnostic d’Active Directory requiert certains outils de diagnostics comme DCDIAG, par exemple. Je vous propose ici un script lance pour vous les principales commandes pour diagnostiquer votre AD.

Voici le script à copier/coller dans un batch, et à améliorer à votre convenance. Celui-ci génère deux fichiers à la racine du lecteur C, repl.csv et diag.txt qui sont correctement formatés. Sinon, j’ai crée un EXE pour ce script.

[bash]

@echo off
title Diagnostic Active Directory
color 1F
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º                                º
echo º   Diagnostic Active Directory  º
echo º                                º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
echo Les diagnostics peuvent prendre un certain temps….
echo.
echo ———————————————
echo.
chcp 1252 >nul
echo ——————————————— >> c:\diag.txt
echo JOURNAL DES DIAGNOSTICS ACTIVE DIRECTORY >> c:\diag.txt
echo. >> c:\diag.txt
echo Generation du %date% %time% >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
echo Diagnostics des services
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostics des services >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
dcdiag /v >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Diagnostics des DNS
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostics des DNS >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
dcdiag /test:DNS /DNSALL /e /v >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Diagnostics des enregistrements DNS
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostics des enregistrements DNS >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
dcdiag /test:RegisterInDNS >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Verification du service DHCP
echo.
echo ——————————————— >> c:\diag.txt
echo Verification du service DHCP >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
netsh dhcp show server >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Diagnostic de la replication
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostic de la replication >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
repadmin /showreps >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Diagnostic avance de la replication
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostic avancé de la replication >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
repadmin /showrepl * /csv >> c:\repl.csv
echo. >> c:\diag.txt
echo.
echo Diagnostic des erreurs de replication
echo.
echo ——————————————— >> c:\diag.txt
echo Diagnostic des erreurs de replication >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
repadmin /replsum /errorsonly >> c:\diag.txt
echo. >> c:\diag.txt
echo. >> c:\diag.txt
echo.
echo Fin des Diagnostics.
echo ——————————————— >> c:\diag.txt
echo Fin des diagnostics >> c:\diag.txt
echo ——————————————— >> c:\diag.txt
echo.
pause
call notepad c:\diag.txt
call notepad c:\repl.csv

[/bash]

Télécharger le fichier exécutable ici.