How to find all users in active directory with the “password expires” setting enabled or disabled

Posted on October 12, 2011

Just quick tip for those running into the need to query users who's passwords are set to expire, or vice versa.
Open up the Windows PowerShell and use the two following commands:

1) To show your list of users and their settings
dsquery user "ou=someOU,dc=yourdomain,dc=ca" -limit 0 | dsget user -email -pwdneverexpires

2) To update all users to yes or no
dsquery user "ou=someOU,dc=yourdomain,dc=ca" -limit 0 | dsmod user -pwdneverexpires yes

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.