Where Are My Properties?

I consistently get asked how to display class specific properties. The solution is simple but not very obvious.

get-monitoringobject ... | format-list *

You are probably wondering why you even need to do this.

You are not alone:)

Each MonitoringObject can be an instance of multiple classes so there is no limit on the number of enumerable properties on each MonitoringObject. To control the formatting experience we only display properties that are essential to identifying the instance you want to manage. To see the remaining properties you must override the default formatter by calling format-list or format-table. When attempting to format an object which has four or more variable length properties I find that format-list works best. Let's take a closer look at displaying all of the properties for each instance of Microsoft.Windows.Computer.

$class = get-monitoringclass | where {$_.Name -eq "Microsoft.Windows.Computer"}

get-monitoringobject -MonitoringClass: $class | format-list *

BTW this approach also works with objects returned by the OperationsManagerMonitoring provider.

PS Monitoring:\localhost

>dir | format-list *

And in case you aren't already aware 'fl' is the alias for format-list so the following command will work as well.

dir | fl *

 

Hope that helps and as always please post your questions and comments and I will make sure they are addressed in future posts.

Roger Sprague