EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
547 stars 58 forks source link

Update DNSScavengingForPrimaryDNSServer.ps1 #33

Closed JasonCook599 closed 5 years ago

JasonCook599 commented 5 years ago

Change DNS last scavenge time to be less than seven days from now, instead of more than seven days ago. Test current fails if scavenging occurred too recently.

PrzemyslawKlys commented 5 years ago

(Get-Date).AddDays(7) = 16th of September. This is the future. Everything will be less than that?

PrzemyslawKlys commented 5 years ago

I think, fix for this would be changing LT to GT and leaving it as is. What do you think?

JasonCook599 commented 5 years ago

Both will work identically and I don't have a strong opinion either way. Personally, I find it easier to read/understand "add seven" than "add negative seven".

PrzemyslawKlys commented 5 years ago

Are you sure?

(Get-Date).AddDays(7) = Future date Any scavenging time - 5 days old, 500 days old will be Less Than that date.

(Get-Date).AddDays(-7) = Past Data (-7 days) We expect scavenging Date to be greater than that. So 1-7 days will work, but not 8.

JasonCook599 commented 5 years ago

You are correct; it should be greater than. I did not think it through fully.

PrzemyslawKlys commented 5 years ago

Thank you, please fix it so I can apply your fix!

PrzemyslawKlys commented 5 years ago

Thank you! Really appreciate it!