- Open the Powershell ISE → Create new script with the following code and run it, specifying the path for export:
# Import the AD module to the session
Import-Module ActiveDirectory
#Search for the users and export report
get-aduser -filter * -properties Name, PasswordNeverExpires | where {
$_.passwordNeverExpires -eq "true" } | Select-Object DistinguishedName,Name,Enabled |
Export-csv c:\data\pw_never_expires.csv -NoTypeInformation
- Open the file produced by the script in MS Excel.
![List of users with password never expires](https://img.netwrix.com/howtos/Excel_8.png)
- Run Netwrix Auditor → Navigate to “Reports” → Open “Active Directory” → Go to “Active Directory - State-in-Time” → Select “User Accounts – Passwords Never Expire” → Click “View”.
- To receive the report regularly by email, click the “Subscribe” button and choose the schedule you prefer.
![User Accounts - Password Never Expire report from Netwrix Auditor: Path and Name](https://img.netwrix.com/howtos/User_accounts_1.png)