Two, three command lines today to search, and list users with a password that never expires, within an Active Directory. As a reminder this practice is not recommended at all, especially for accounts with strong privileges.
You can copy and paste the code below, it will generate a .csv file in the directory c:\temp\
#Importe the ActiveDirectory module
#Recherche users with a password set to "never expire"
get-aduser -filter -properties Name, PasswordNeverExpires where
$.passwordNeverExpires -eq "true" Select-Object DistinguishedName,Name,Enabled
Export-csv v: Temp-PasswordNeverExpire.csv -NoTypeInformation
Hope this help you!
Hi ! I’m Maxime. Founder and independant author of vDays.net. I have worked in service IT since 6 years ago, after a 5 years’ internship. Via this blog, I would like share and discuss with you on new technologies, especially on virtualization and VMware. If you want to know more about me, check out my “about me” page or follow me on Twitter and LinkedIn