Groups and related information
Return state of a group
foreach($a in get-monitoringobjectgroup){if($a.DisplayName -eq "group name"){$a.HealthState}}
Return contained instances of a group and state of each instance
foreach ($group in get-monitoringobjectGroup) {if($group.DisplayName -eq "group name") {$group.GetRelatedMonitoringObjects() | ft DisplayName,HealthState}}
Return management pack a group is stored in
ForEach ($Group in get-MonitoringObjectGroup) {If ($Group.DisplayName -eq "group name") {get-MonitoringClass | where {$_.Id -eq $Group.Id.ToString()} | Foreach-Object {$_.getManagementPack()} | Select @{Name="Group Name";Expression={$Group.DisplayName}},@{Name="MP Name";Expression={$_.Name}},@{Name="MP DisplayName";Expression={$_.DisplayName}} | fl}}
Comments
- Anonymous
July 19, 2010
excellent