Posts Tagged: Script

Auditing: Report and Disable Inactive AD User Accounts

The below can be run as a scheduled task to detect and disable accounts that have not been used for a specified amount of days or for accounts which have never been used.

Report outputs to a CSV and is displayed as follows:

https://github.com/roggyuk/PS-ADUDisableReport

Auditing: Reset Passwords That Expire Today

The below can be run as a scheduled task to detect Active Directory User accounts that have passwords that expire today. Any objects where the password is due to expire today will automatically have the “Change password at next logon” ticked meaning that they wont suddenly lose connection to things such as mapped drives at the original expiry time.

Credit to Andrew Lyonette for turning my “Why dont you solve it like this” in to the script below.
https://www.linkedin.com/in/andylyonette/

Auditing: Report and Disable Inactive AD Computer Accounts

The below can be run as a scheduled task to detect and disable accounts that have not been used for a specified amount of days or for accounts which have never been used.

Report outputs to a CSV and is displayed as follows: