How to get a list of users with passwords set to never expire.
A common enough request is to produce a list of user who’s passwords aren’t meeting company password policy. The likely reason for this unless you have set fine grained policies is that you have users with passwords set to never expire in their active directory object. Sometimes a bit of house keeping is in order and as managers tend to prefer things in spread sheets than text files so I have added the export-csv cmdlet.
Search-ADAccount -PasswordNeverExpires | select-object Name,ObjectClass | export-csv filepath.csv