Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Reset AD password expiry for the specified account once per week
- Import-Module ActiveDirectory
- [string]$user = "someuser" ; while(1) { get-date ; set-ADUser -Identity $user -replace @{ pwdlastset = 0 } ; set-ADUser -Identity $user -replace @{ pwdlastset = -1 } ; Get-ADUser -Identity $user -Properties * | select password* ; start-sleep -Seconds (60*60*24*7) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement