List Disabled User by name on Active Directory


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 = “



$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 -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 ?