Skip to content

Instantly share code, notes, and snippets.

@michaelrice136
Created March 29, 2016 09:57
Show Gist options
  • Save michaelrice136/02bcb7afeb55aa3b4907 to your computer and use it in GitHub Desktop.
Save michaelrice136/02bcb7afeb55aa3b4907 to your computer and use it in GitHub Desktop.
Extend password expire date for all AD users to max domain policy time period
$Users = Get-ADUser -Filter * -properties pwdlastset
foreach ($user in $users)
{
$User.pwdlastset = 0
Set-ADUser -Instance $User
$user.pwdlastset = -1
Set-ADUser -instance $User
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment