Find Users With Password Never Expires in Active Directory Using PowerShell

0

How to Get Users With Password Never Expires in Active Directory Using PowerShell

Powershell is a powerfull tool which can be used to analyze and export data for multiple tasks in Active Directory. Today, We will find how we can export the list of users who have password never expire attribute set to True. When this attribute is set to True then Password group policy doesn’t apply to User and it is considered an exception. So we can say if we have Password expiry GPO on domain level that will be applied to all users unless a user has Password never expire is checked in the Account tab of User’s properties.
Password Never Expires

Now, Let’s see how we can get the list of Users with never expiring password.
Step1- Open Active Directory Module for Windows PowerShell
Step2-  Copy the following command and press enter. it will create a file with user’s details in C:\temp directory.

Get-aduser -filter * -properties Name, PasswordNeverExpires | where {$_.passwordNeverExpires -eq “true” } | Select-Object DistinguishedName,Name,Enabled | Export-csv c:\temp\Aduser_never_expires.csv -NoTypeInformation

PowerShell for Never Expire AD Users

Step 3- You can open the file using Microsoft Excel and find all the details which include User’s location, name, and status in Active Directory

CSV Never Expire Password

 

Leave A Reply

Your email address will not be published.