Get AD User Password Expiry Report

We keep running into the issue where in many networks, some only 5 user and other 150+ user environments, users forget to change their passwords every 90 days. Even though we have the domains configured to start warning them 7 days ahead of time, they seem to ignore the little bubble. Anyone that has ever maintained a directory server, whether it is OpenLDAP or Active Directory, can relate to the few users that continue to forget. After multiple weekends where all hell would rain down Monday morning due to passwords expiring on Friday afternoon, a solution needed to be found.

Do not fret! We have created a great Powershell script, which can be used in a daily scheduled task, to run a report that contains a list of user accounts which will expire soon, while it nags the users to change or update their password before it expires. This report is then also emailed to the IT manager, the IS department, or whomever takes care of password resets.

To keep the script modular, the parameters do not have to be called in the scheduled task so they can be modified before scheduling, as well as makes it easy to call the script for one-off runs. Though, as it can be seen, we have not provided any help files or synopsis for the function, as that may come later.

Comments

  1. I had to change the date formats,

    line 143 $Today = (Get-Date -UFormat %c )

    and

    line 182 $ReportDateTime = (Get-Date -UFormat %m-%d-%y )

Leave a Reply

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