List Disabled User by name on Active Directory

Hi,

I try to build powershell command which will list the disabled users by name on Influxdb. My command output showing the users but I can not showing the output on Grafana.

My command is;

$influxDB = “http://10.0.0.1:8086

while($true)

{

$count = (Search-ADAccount -AccountDisabled -UsersOnly).count

$disabledAccount = Search-ADAccount -AccountDisabled -UsersOnly | FT name | Out-String

$Metrics = @{

“LockedCount” = $count

“LockedName” = $disabledAccount

}

Write-Influx -Measure Server -Tags @{Server=$env:COMPUTERNAME} -Metrics $Metrics -Database POWERSHELL -Server http://10.0.0.1:8086 -Verbose

}

In grafana when I try to build query, disabled users showing on one tab not list .

I guess my powershell command is wrong or missing and I don t know how to fix.

Any idea ?

Thanks,