Last active
April 18, 2020 19:39
-
-
Save ergosteur/8a8907c3fdf39b701a4674b7251a419c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://activedirectorypro.com/how-to-get-ad-users-password-expiration-date/ | |
$cred = Get-Credential | |
Get-ADUser -server domaincontroller.domain -credential $cred -filter {Description -like "SRI*" -and Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | | |
Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment