Skip to content

Instantly share code, notes, and snippets.

@davejlong
Last active April 21, 2021 01:23
Show Gist options
  • Save davejlong/d90a1af8260131378859b9ce80a60daa to your computer and use it in GitHub Desktop.
Save davejlong/d90a1af8260131378859b9ce80a60daa to your computer and use it in GitHub Desktop.
###
# Author: Dave Long <[email protected]>
# Date: 2021-04-20
#
# Gets a list of all alerts for a host and exports them
# to a CSV
#
# Usage:
# $ Get-AlertsReport.ps1 -MachineName CONTOSO-DC-01
#
# Creates a CSV named alerts.CONTOSO-DC-01.csv
###
[CmdletBinding()]
param (
[Parameter()]
[String]
$MachineName
)
$Agent = Get-AteraAgent -MachineName $MachineName
Set-AteraRecordLimit -Limit 10000
$Alerts = Get-AteraAlerts -Open -Resolved -Snoozed | Where-Object DeviceGuid -eq $Agent.DeviceGuid
$Alerts | Export-CSv -Path alerts.$($Agent.MachineName).csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment