top of page
Search

Finding where that dang lockout is coming from

  • ToddimusPrime
  • May 12, 2021
  • 1 min read

AD accounts that keep locking themselves out. It can be a huge pain to find where those lockouts are coming from. Try running this! It'll give you a list of users that are locked out, along with whatever device the lockout came from.


$PDC = (Get-ADDomain).PDCEmulator

$events = Get-WinEvent -ComputerName $PDC -FilterHashtable @{
    LogName = 'Security'
    ID = 4740
}
foreach ($event in $events){
    [pscustomobject]@{
        UserName = $event.Properties[0].Value
        CallerComputer = $event.Properties[1].Value
        TimeStamp = $event.TimeCreated
    }
}

Comments


©2021 by ToddimusPrime

bottom of page