In SquaredUp Dashboard Server, when you create an enterprise application, there is a perspective with all the alerts of that enterprise application.
I now want to be able to use PowerShell to find out to which enterprise application a scom alert belongs. So actually in the reverse order.
How can I achieve this starting from the get-scomalert -id command?
Thanks,
Luc
I haven’t worked a lot with the EAs created by SquaredUp (I build my own) so I’m not sure about the base class. My EAs are based off the System.Service base class, so should be close if not the same.
The SCOMAlert returns the Guid of the instance and you can use the relationship instance to determine the EA. So try this:
$BaseClass = Get-SCOMClass -Name System.Service #use whatever baseclass you have determined
$Alert = get-scomalert -id xxxxxx
$Instance = Get-SCOMClassInstance -Id $Alert.MonitoringObjectId.Guid
Get-SCOMRelationshipInstance -TargetInstance $Instance | Select -ExpandProperty SourceObject | ?{ (Get-SCOMClass -id $_.LeastDerivedNonAbstractManagementPackClassId).Base.ID.Guid -eq $BaseClass.Id.Guid }
HTH