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\
1 2 3 4 5 6 7 |
#Importe the ActiveDirectory module Import-Module ActiveDirectory #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