[SCRIPT]- Powershell: List users with a password that never expires
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 |