r/PowerShell • • Feb 20 '20

Script Sharing Active Directory DFS Health Check with PowerShell

Last few months I've been working on 2 PowerShell modules - ADEssentials and Testimo. One provides detailed, fully automated commands to deliver different AD cmdlets. The other one uses those to deliver automated reporting.

Extended information in the blog post: https://evotec.xyz/active-directory-dfs-health-check-with-powershell/

Sources for both:

With Get-WinADDFSHealth command you can a simple summary of your DFS Health

But also additional details you can expand on

Invoke-Testimo, on the other hand, delivers the results in form Pass/Fail making it easy to quickly asses if your DFS is working or not without spending more then 5 minutes per day on it.

And if you're really into full report - Invoke-Testimo does that as well

But it also is able to do a lot more as you can tell it to run multiple reports at once:

Invoke-Testimo -Sources DCDFS,DCLDAP,DCLDAPInsecureBindings,DomainGroupPolicyMissingPermissions -ShowReport

And that is just the tip of an iceberg.

Hope you like this one. Both ADEssentials and Testimo are under Active development.

130 Upvotes

15 comments sorted by

6

u/SUBnet192 Feb 20 '20

2nd screenshot shows object names instead of values for events. Good work overall, useful stuff!

4

u/MadBoyEvo Feb 20 '20

Yes, it does. This is because you expand on it.

$Health[5].DFSEvents | Format-List can give you additional details about it. Otherwise, it would be much less useful.

2

u/SUBnet192 Feb 20 '20 edited Feb 24 '20

Silly me didn't notice it wasn't the final output of the command :)

1

u/phr0ste Feb 20 '20

Thank you so much for posting this. DFS can be a nightmare sometimes. Adding this to my next change control!

1

u/MadBoyEvo Feb 21 '20

It can be, and if it's down things are not applying correctly.

3

u/ViperVnDm Feb 21 '20

In my experience DFS just seems to always be unhappy eventually.

2

u/MadBoyEvo Feb 21 '20

Ye, that's why we should keep it happy by frequent checks. Doing it once per year may be too little ;)

1

u/Vandafrost Feb 21 '20

Is their any setting requirements neccesary?

I'am getting "Status: False, Replication: Unknown" for all my DCs.
I checked the replication and everything is fine.

1

u/MadBoyEvo Feb 21 '20

PS 5.1 i guess, RSAT should be sufficient.

1

u/Vandafrost Feb 21 '20

Ok I have both :/ The command is counting the files and showing „DFSEvents: 0“

1

u/MadBoyEvo Feb 21 '20

Maybe lack of permissions? Running this as admin?

2

u/Vandafrost Feb 21 '20

I think I found it.

I hat to run it as an admin first place.
So i am getting "Status:False ReplicationState:Normal" now

We restartet our DCs last night for patches.
So we got the log event 5008 and this is "unhealthy" in Testimo.

Thanks for your help and your work!

2

u/MadBoyEvo Feb 21 '20

Ye, I think I need to change [int] $EventDays into [int] $Hours. Otherwise 24h since reboot needs to happen before it says it's ok.

1

u/techguy404 Mar 23 '20

could this be used to check the health of just regular fileservers running DFS?

1

u/MadBoyEvo Mar 23 '20

Nope. Its focused on AD DfS. One could build something for standard DFS.