Direct Inward Dialing: +1 408 916 9892
One of the biggest challenges of IT administrators is to track the source of an account lockout. You can always get this information using Windows PowerShell but that would be a complicated process. Alternatively, you can use a comprehensive AD auditing tool like ADAudit Plus to achieve this goal.
This article compares how you can track the source of an account lockout using Windows PowerShell and ADAudit Plus:
#requires -Module ActiveDirectory #Import-Module ActiveDirectory -EA Stop Function Get-AccountLockoutStatus { [CmdletBinding()] param( [Parameter( ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=0)] [string[]] $ComputerName = (Get-ADDomainController -Filter * | select -ExpandProperty Name), [Parameter()] [string] $Username, [Parameter()] [int] $DaysFromToday = 3 ) BEGIN { $Object = @() } PROCESS { Foreach ($Computer in $ComputerName) { try { $EventID = Get-WinEvent -ComputerName $Computer -FilterHashtable @{Logname = 'Security'; ID = 4740; StartTime = (Get-Date).AddDays(-$DaysFromToday)} -EA 0 Foreach ($Event in $EventID) { $Properties = @{Computername = $Computer Time = $Event.TimeCreated Username = $Event.Properties.value[0] CallerComputer = $Event.Properties.value[1] } $Object += New-Object -TypeName PSObject -Property $Properties | Select ComputerName, Username, Time, CallerComputer } } catch { $ErrorMessage = $Computer + " Error: " + $_.Exception.Message } finally { if ($Username) { Write-Output $Object | Where-Object {$_.Username -eq $Username} } else { Write-Output $Object } $Object = $null } } } END {} }
The following are the limitations of using PowerShell to track the source of an account lockout:
On the other hand, ADAudit Plus will quickly scan all DCs in the domain to retrieve information about the probable source of an account lockout in the form of an intuitive report. IT administrators can use this information to investigate and solve the problem.
Logon-Logoff
Account lockouts
Windows event logs
File server auditing
Active Directory auditing
Azure AD
Server auditing
Computer start-ups and shut-downs