Mundy

IT Knowledge Base

User Tools

Site Tools


Sidebar

Contact me at dan@mundy.co for any feedback or suggestions.


My other sites:

Search all my sites:

find_all_users_with_password_never_expires

Find all users with "Password Never Expires"

Powershell

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

Archive

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: [http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/ec8201193bd5acf4?pli=1 microsoft.public.scripting.vbscript]




There's also a [http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug05/hey0829.mspx “Hey, Scripting Guy” article] using VBscript but I couldn't make it work.

There's also a free utility called [http://joeware.net/freetools/tools/adfind/index.htm 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)