Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED Get the password expiry date of users

Status
Not open for further replies.

Harshit Pandey

Well-Known Member
Messages
278
Solutions
8
Reaction score
8
Points
18
Hi,

I work in a company that has got more than 2000 users. We have AD password policies and all things are working fine. I want to know is there a way to get the password expiry date of user or group of users ?. If anyone knows it please help.
 
Solution
Get Password Expiry date of all users in Active Directory domain
Code:
Get-ADUser -Filter {Enabled -eq "True"} -Properties Name, msDS-UserPasswordExpiryTimeComputed | Select Name,@{Name="Expiry Date";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}

Get Password Expiry date of all users that are in the Test OU
Code:
Get-ADUser-SearchBase"OU=Test,DC=Contoso,DC=Com"-Filter{Enabled-eq"True"}-PropertiesName,msDS-UserPasswordExpiryTimeComputed|SelectName,@{Name="Expiry Date";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}}
Get Password Expiry date of all users in Active Directory domain
Code:
Get-ADUser -Filter {Enabled -eq "True"} -Properties Name, msDS-UserPasswordExpiryTimeComputed | Select Name,@{Name="Expiry Date";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}

Get Password Expiry date of all users that are in the Test OU
Code:
Get-ADUser-SearchBase"OU=Test,DC=Contoso,DC=Com"-Filter{Enabled-eq"True"}-PropertiesName,msDS-UserPasswordExpiryTimeComputed|SelectName,@{Name="Expiry Date";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}}
 
Solution
Status
Not open for further replies.

Forum statistics

Threads
7,043
Messages
27,535
Members
17,729
Latest member
ironmonkey

Trending content

Back
Top