Last active
April 21, 2021 01:23
-
-
Save davejlong/d90a1af8260131378859b9ce80a60daa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# 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