This is one of my work that is being used by thousands of customers, it was downloaded more than 30000 times before Microsoft TechNet gallery was retired. (AD Health Check V1)
I can still see a lot of interest in this script so parameterizing/small updates and placing it in Powershell Gallery for ease of download.
Download the script from Powershell gallery by using below command:
Install-Script -Name ADHealthCheckV2
You can also get this from Github using below link:
Change to the location where you have placed the script, you can either enter the information such as smtp server on prompt or follow syntax described below in this post.
If you just press enter without adding any information, it will just generate the report in the same folder.
Use this syntax and save it in batch file so you do not have to enter information in the prompt again and again.
Note: Run as Powershell windows Administrator else you will see fails in some environments.
Single recipient Syntax:
.\ADHealthCheckV2.ps1 -Smtphost smtpserver -from donotreply@labtest.com -EmailReport vikas1@labtest.com
Multiple recipient Syntax:
.\ADHealthCheckV2.ps1 -Smtphost smtpserver -from donotreply@labtest.com -EmailReport “vikas1@labtest.com,vikas2@labtest.com”
Batch file syntax:
Powershell .\ADHealthCheckV2.ps1 -Smtphost smtpserver -from donotreply@labtest.com -EmailReport vikas1@labtest.com
Timeout value is by default set at 60, you can increase it if you want. (This is how long it will wait for DC to report for the test)
.\ADHealthCheckV2.ps1 -Smtphost smtpserver -from donotreply@labtest.com -EmailReport vikas1@labtest.com -timeout 120
You will receive the report on email as below:
Enjoy the new updated version and deploy to your environment.
Thanks for reading and downloading….
Tech Wizard
Hello and thanks for your script.
It doesn’t works with my French Windows Server 2016 Active Directory :
PS C:\Script\ADHealthCheck> $sysvol = start-job -scriptblock {dcdiag /test:Replications}
PS C:\Script\ADHealthCheck> $sysvol.state
Completed
State show Completed and not Running
I’m stupid sorry, juste need to change Passed test” to “réussi”
Pingback: Active Directory Health Check | Tech Wizard
We found we needed to increase the timeout to 120 if there are any Server 2022 DC’s in the forest. Thanks for the updated script!
I need e-mail with password
I did not get your query ?
No, with google email, need email and password to send
https://support.google.com/mail/answer/7126229
We’re having issues running the script from Windows 11. Specifically the dcdiag ‘services’ test is failing. on one of the DCs the ‘netlogon’ service is not being reported although it is running
it looks like dcdiag on windows 11 has issues with the ‘services’ test. The error I get is:
Invalid service type: DnsCache on , current value WIN32_SHARE_PROCESS, expected value WIN32_OWN_PROCESS
……………………. failed test Services
I have not tested the script with win 11 and as of now no plans to test it.