PowerShell script to obtain the health of your domain. Passed back as a single object.

Jan 5, 2021 | Scripting and programming, Server administration, Technology, Windows | 0 comments

I have used a script for a few years now to check the health of the active directory domain that I’m responsible for in work.  It’s a very useful report written using PowerShell that highlights servers that need attention.  There’s a problem though.  One of the good kind of problems.  The domain hasn’t had a single problem relating to services, FSMO or replication in about four years. So this report is largely ignored.  Every few weeks I go and check it or if something goes wrong and I have any kind of suspicion it could be replication related, I’ll go glance at it really quickly but overall, it’s left there.  This means that potentially something small could go wrong with a component of active directory and I could miss it.  This doesn’t sit right with me.  So as part of a few PowerShell scripts I’ve been writing lately, this regular task was up for review.  My aim is very simple.  Export the report as an object.  Save that object as a JSON formatted file.  Then every hour, go check that JSON file and verify there are no differences.  If a difference is failed, then alert the world that something horrible has happened. The script checks the areas that need to be checked.  This includes DNS, Netlogon, FSMO, replication, advertisements, NTDS, Syslog and ping. I got the original script from here.  It has been modified over the years.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.