Find accounts that will expire in 30 days
Search-ADAccount -AccountExpiring -TimeSpan 30.00:00:00 -UsersOnly |Where-Object {$_.enabled -eq$true} | Select-Object name,samaccountname,enabled,accountexpirationdate |sort accountexpirationdate
Find accounts that has expired
Search-ADAccount -AccountExpired -UsersOnly | Where-Object {$_.enabled -eq$true} | Select-Object name,samaccountname,enabled,accountexpirationdate | sort accountexpirationdate -Descending
When will my account expire
Get-ADUser $env:USERNAME -Properties accountexpirationdate | Select-Object samaccountname,accountexpirationdate | fl