Active Directory Health Check V2

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:

AD Health Check V2

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

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Fast Track

11 thoughts on “Active Directory Health Check V2

  1. 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

  2. Pingback: Active Directory Health Check | Tech Wizard

  3. 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!

  4. 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

  5. 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

Leave a comment