Finding Active Directory passwords set to never expire
You can print out the accounts with Password Never Expires definition in your structure with the code I have shared below.
When you run the code below with powershell, it exports the list of accounts that you want the password to never expire to C:\Temp\PassNeverExpiresUsers.CSV.
Search-ADAccount -PasswordNeverExpires -UsersOnly -ResultPageSize 2000 -resultSetSize $null | Select-Object Name, SamAccountName, DistinguishedName | Export-CSV “C:\Temp\PassNeverExpiresUsers.CSV” -NoTypeInformation
Yorumlar (0)