cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Disabling "Canned" Alerts

In a recent vSWUG presentation, I mentioned that I (personally) would disable all out of the box alerts.  Within the Orion database, these are referred to as "canned" alerts and you can do it with a simple PowerShell script (assuming you have the SwisPowerShell module loaded).

<# Disable-OOTBAlerts.ps1 #>
$SwisConnection = Connect-Swis -Hostname 'orion.domain.local' `
                               -UserName 'Account' `
                               -Password 'P@ssw0rd'
$Query = @"
SELECT Name
     , Uri
FROM Orion.AlertConfigurations
WHERE Canned = 'TRUE'
  AND Enabled = 'TRUE'
"@
$Alerts = Get-SwisData -SwisConnection $SwisConnection -Query $Query
ForEach ( $Alert in $Alerts ) {
    Write-Host "Disabling OOTB Alert: $( $Alert.Name )"
    Set-SwisObject -SwisConnection $SwisConnection `
                   -Uri $Alert.Uri `
                   -Properties @{ Enabled = 'FALSE' }
}
Version history
Revision #:
1 of 1
Last update:
‎05-26-2020 11:24 PM
Updated by: