IT Knowledge Base

User Tools

Site Tools


Contact me at for any feedback or suggestions.

My other sites:

Search all my sites:


Find all users with "Password Never Expires"


get-aduser -filter * -properties Name, PasswordNeverExpires, Description | where { $_.passwordNeverExpires -eq "true" } | where {$_.enabled -eq "true"} | ft SamAccountName, Description


To list all user accounts along with their “never expires” attribute:

dsquery user | dsget user -samid -pwdneverexpires

To list only those with “never expires” in a text file:

dsquery user | dsget user -samid -pwdneverexpires | find "yes" > never-expires.txt

To also filter by active users only type:

dsquery user | dsget user -samid -pwdneverexpires -disabled | find "yes                no"

Source: [ microsoft.public.scripting.vbscript]

There's also a [ “Hey, Scripting Guy” article] using VBscript but I couldn't make it work.

There's also a free utility called [ ADFind] but I couldn't make that work either (maybe it was blocked by AV)

See also:

* Freeware command line / batch account rename
* Set Password Never Expires using PowerShell

find_all_users_with_password_never_expires.txt · Last modified: 2018/04/09 09:56 (external edit)