OsbornePro / BTPS-SecPack

This repository contains a collection of PowerShell tools that can be utilized to protect and defend an environment based on the recommendations of multiple cyber security researchers at Microsoft. These tools were created with a small to medium size enterprise environment in mind as smaller organizations do not always have the type of funding available to overly spend on security. The goal of this project is to help add value to an smaller organizations security by creating more visibility for the average IT Administrator. Organizations with 1,000’s of devices may find that this entire suite does not apply to them.
https://btpssecpack.osbornepro.com
GNU General Public License v2.0
48 stars 11 forks source link

Seems there is a wrong if condition #3

Closed lwh19970531 closed 7 months ago

lwh19970531 commented 7 months ago

https://github.com/OsbornePro/BTPS-SecPack/blob/31f3323e00aafc10584b2da8d81c4c978374b995/Account%20and%20Password%20Alerts/PasswordExpiryAlert.ps1#L54C5-L54C5

"$ExpirationDate -ge $TodaysDate" should be "$ExpirationDate -le $TodaysDate" or "$TodaysDate -ge $ExpirationDate"?

tobor88 commented 7 months ago

It appears you are not looking at the most current branch. Be sure you have "master" selected. I ended up changing that line too (($TodaysDate -ge $ExpirationDate.AddDays(-15)) -and ($TodaysDate -le $ExpirationDate)). Let me know if you come acros anything else