ADScripts/Get-ExpiredUsers.ps1
2023-09-14 11:13:58 -06:00

2 lines
311 B
PowerShell

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