July 12

How to find AD users Password Expiration Date and find all users with password never expires

Find AD users Password Expiration Date

Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties DisplayName, msDS-UserPasswordExpiryTimeComputed | Select-Object -Property Displayname,@{Name=”Expiration Date”;Expression={[datetime]::FromFileTime($_.”msDS-UserPasswordExpiryTimeComputed”)}}

Find all users with password never expires

get-aduser -filter * -properties Name, PasswordNeverExpires | where { $_.passwordNeverExpires -eq “true” } | where {$_.enabled -eq “true”}| Format-Table -Property Name, PasswordNeverExpires -AutoSize


Posted July 12, 2023 by Ray in category "Windows Server

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.