MyITGuy
11/15/2014 - 8:43 PM

PowerShell: Locked Out Accounts with Lockout Time

PowerShell: Locked Out Accounts with Lockout Time

Search-ADAccount -LockedOut | Get-ADUser -Properties lockoutTime | Select @{Name="sAMAccountName";Expression={$_.sAMAccountName.ToUpper()}},@{Name="LockoutTime";Expression={([datetime]::FromFileTime($_.lockoutTime).ToLocalTime())}} | Sort LockoutTime -Descending