Does anyone know if you can leverage the Automox API to show the Policy Compliance for a device? We’d like the ability to report the system status policy (EX: Compliant / Non-Compliant) and show this on the desktop using bginfo.
Thank you!
Does anyone know if you can leverage the Automox API to show the Policy Compliance for a device? We’d like the ability to report the system status policy (EX: Compliant / Non-Compliant) and show this on the desktop using bginfo.
Thank you!
Hi,
Also - there’s a lot of work being done right now on our reporting capabilities. In my own, humble, personal opinion...this is an area where AX needs improvement. But, we’ve got an entire team of engineers dedicated to building out more functionality and reports with more actionable info. So stay tuned!
Hi,
Also - there’s a lot of work being done right now on our reporting capabilities. In my own, humble, personal opinion...this is an area where AX needs improvement. But, we’ve got an entire team of engineers dedicated to building out more functionality and reports with more actionable info. So stay tuned!
BGInfo Desktop Example:
Patch Status: Compliant / Non-Compliant (Automox API) lCompliant (Green), Non-Compliant (Red)]
Host Name: {Computer_Name} (BGInfo)
Service Tag: {Dell_ServiceTag) (BGInfo)
Our initial run through your API, we didn’t know if it was a query based on the following:
API Query: https://console.automox.com/api/servers?o=$orgID&api_key=$apiKey
I believe we’re just trying to tap into the Device Compliance indicator in the console.
Thank you so much for your help!
This will be unconventional… But there is a way.
Now that the policy info is collected some more code is needed to then build out the BGInfo solution side of this.
$orgID = 00000 # enter your OrgID
$policy = 000001 # enter your PolicyID
$apiKey = Read-Host "api-key: "
$headers = @{ "Authorization" = "Bearer $apiKey" }
# Look at a policy status from last 7 days
$start = (Get-Date).AddDays(-7)
$start = Get-Date $start -f 'yyyy-MM-dd'
$end = Get-Date -f 'yyyy-MM-dd'
$i = 0
$data = do{
$url = "https://console.automox.com/api/events?o=$orgID&policyId=$policy&limit=500&page=$i&startDate=$start&endDate=$end&device_names=sp14393"
$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers).Content | ConvertFrom-Json
$response | % {
$name = $_.server_name
$id = $_.server_id
pscustomobject] @{
host = $name
hostid = $id
status = $_.data.status
timestamp = $_.create_time
}
}
$i++
}
while ($response)
# Taking the data collected and extracting the device ID
$ClientID = ($data | Where-Object host -eq $env:COMPUTERNAME).hostid
$url = "https://console.automox.com/api/servers/$ClientID`?o=$orgID"
$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers).Content | ConvertFrom-Json
# policy results
$response.policy_status
I’ll give this a shot and report back afterwards. I really appreciate the help!
# Export results to TXT file
$status = $response.policy_status | % {
$status = IF($_.status -eq 1){'Compliant'}else{'Non-Compliant'}
pscustomobject]@{
policy = $_.policy_name
status = $status
exit_code = $_.status
}
}
$status | out-file C:\BGInfo\Automox.txt
Good luck!
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.