Skip to content

Instantly share code, notes, and snippets.

@shkpk
Created September 9, 2018 10:21
Show Gist options
  • Save shkpk/8563220e7ba743d44b8ef752a17ab16a to your computer and use it in GitHub Desktop.
Save shkpk/8563220e7ba743d44b8ef752a17ab16a to your computer and use it in GitHub Desktop.
# Bind to user object in AD.
$User = [ADSI]"LDAP://cn=Jim Smith,ou=West,dc=MyDomain,dc=com"
# Expire password immediately.
$User.pwdLastSet = 0
# Save change in AD.
$User.SetInfo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment