Question

installed updstes report

  • 8 December 2023
  • 2 replies
  • 75 views

Badge

How do you generate a report of installed updates on app systems  for a certain period of time ( 1 month up to 1 year) for adding purpose 


2 replies

Userlevel 2
Badge +1

Hello curiostoknow, 

 

Have you taken a look at the activity log? 
You can specify a custom date range, and then add additional filters based on the policy type. 

Also, you can export to a CSV file if you want to drill down further in Excel. 

https://console.automox.com/reports/activity-log

Userlevel 5
Badge +1

@curioustoknow you could try this code. 

 

# Automox API Parameters
$apiKey = Read-Host 'api-key'
$orgID = Read-Host 'orgID'
$headers = @{ "Authorization" = "Bearer $apiKey" }

# Get Policy Results
$policy = Read-Host 'PolicyID' # Patch Policy of Choice
$date = (Get-Date).AddMonths(-12)
$start = Get-Date $date -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"
$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers).Content | ConvertFrom-Json

$response | % {
$text = $_.data.text -split "`n"
$device = $_.server_name

[pscustomobject] @{
device = $device
policy = $_.policy_name
log = $text
}
}
$i++
}
while ($response)
$data | Export-Csv C:\patching.csv -NoTypeInformation

 

Reply