recently i had to face some rule which need to output the health state of some Distributed Applications in OpsMgr, I used the Operations Manager module for powershell.. .after long researching I finally built the below code :
$ObjectState = (get-monitoringclass | Where-Object {$_.displayname -eq “Operations Manager Management Group” -and $_.Description -like “This type represents the Operations Manager Management Group.”} |get-monitoringobject).HealthState
You can find the display name and description while running the get-monitoringclass without any parameters, usually, as I have noticed, the Path of the object is equal to the display name.
That’s it, no need to connect the SQL server and run some bizarre queries, just pure powershell scripting.
Many thanks for taking time to write down this write-up. It is been extremely useful. It could not have come at a much better time for me!
Great work! This is the type of information that are meant to be shared across the web. Shame on Google for not positioning this publish upper! Come on over and discuss with my site . Thanks =)
Hi there to every body, it’s my first visit of this webpage;
this website contains amazing and truly fine data for readers.
This does not work in scom 2012? I think it needs to be modified There is no command get-monitoringclass
For scom 2012 you should change the commands with scom prefix…
This code works for 2007 r2… has to be changed for 2012 with the new commands 🙂