I could use some help creating a dashboard (preferably modern) showing the user account lockouts on each domain controller. I have a SAM template gathering the username, lockout time, and domain controller the account is locked out on. The template is applied to each domain controller, but I'm trying to consolidate the lockout data into a dashboard showing all Usernames, Lockout Date\Time, and the Domain controller the lockout occured on.
I'm new to making dashboards and my SWQL skills are not strong. Is there any quick guidance you can give me to create this simple dashboard? If it helps, the Powershell script I'm using to gather the information is shown below.
$lockedAccounts = Search-ADAccount -LockedOut -UsersOnly | Sort-Object -Descending -Property LastLogonDate
If (!$lockedAccounts)
{
Write-Host "Statistic.LockedAccounts: 0"
Write-Host "Message.LockedAccounts: No accounts are locked out."
Break
}
$lockedOutput = @()
ForEach ($account in $lockedAccounts) {
If ($account.SamAccountName -notin $args)
{
$lockedUser = $account.UserPrincipalName
$lockedDate = $account.LastLogonDate
$lockedOutput += "$lockedUser ($lockedDate)"
}
}
$lockedCount = $lockedOutput.Count
$lockedList = $lockedOutput -join ', '
Write-Host "Statistic.LockedAccounts: $lockedCount"
Write-Host "Message.LockedAccounts: $lockedList"