Skip to content

Instantly share code, notes, and snippets.

@jespernohr
Created October 9, 2015 10:55
Show Gist options
  • Save jespernohr/cb0bfc329980cb149ba9 to your computer and use it in GitHub Desktop.
Save jespernohr/cb0bfc329980cb149ba9 to your computer and use it in GitHub Desktop.
# set all users in an OU to have password expiration enabled.
# use -limit x if you have more that 100 users in the OU.
dsquery user "OU=Postal Workers,OU=Nuuk,OU=Users,OU=Business Unit,DC=test,DC=contoso,DC=com" -limit 2000 | dsmod user -pwdneverexpires no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment