Regular expressions to track the list of users with no password expiration from Microsoft Active Directory.
- Windows PowerShell
Get-ADUser -Filter * -Properties * | Select-Object Name, SamAccountName, Enabled, LastLogonDate, PasswordLastSet, PasswordNeverExpires, AccountLockoutTime, Created, Description
Export:out-gridview -title "PasswordNeverExpires"
– Output to windowExport-Csv -NoTypeInformation -encoding UTF8 "C:\file.csv"
– Output to File