This script was working and just stopped working with 2019.4.
Any ideas dtanner ?
I saw a similar posting (https://thwack.solarwinds.com/t5/Discussions/ClearAlert-Verb-in-Orion-AlertActive-Entity/td-p/340633) but that did not resolve it.
The problem verb is: Orion.AlertConfigurations Export. The $AlertID worked fine previously, but no longer works.
The error I'm getting is:
Invoke-SwisVerb : Verb Orion.AlertConfigurations.Export cannot unpackage parameter 0 of type System.Int32
At line:18 char:32
+ ... dAlertsrc=Invoke-SwisVerb $swissrc Orion.AlertConfigurations Export ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
This is the code:
Add-PSSnapin swissnapin
$swisdst = Connect-Swis -Hostname x.x.x.x -u "cscoengineer" -p "xxxx"
$AlertIDDST = Get-SwisData -SwisConnection $swisdst -Query "select Name from Orion.AlertConfigurations where name='$($AlertID.Name)'"
#Write-Output "SRC:$($AlertID.Name) DST:$($AlertIDDST.Name) XXX:$AlertIDDST"
if ($AlertIDDst -eq $null) {
Write-Output "Alert not in DST. Migrating Alert:$($AlertID.Name)"
$ExportedAlertsrc=Invoke-SwisVerb $swissrc Orion.AlertConfigurations Export $AlertID
#Invoke-SwisVerb $swisdst Orion.AlertConfigurations Import $ExportedAlertSRC
}
else
{Write-Output "Alert in DST. Skipping: $($AlertID.Name)" }
}