Active Directory

Active Directory: How long before my account password expires?

A little PowerShell script to determine when your (or a group of) account(s) will expire: Get-ADUser -filter {SamAccountName -like “*walk*”} -Properties * | select Name,SamAccountName,PasswordExpired,PasswordLastSet, @{E={$ts=$((New-TimeSpan -End $($_.PasswordLastSet).AddDays(60) -Start (Get-Date)));”$($ts.days) Day(s), $($ts.hours) hr(s), $($ts.minutes) min(s)”};L=”TimeToExpiry”} | sort Name | ft…