Freigeben über


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

Comments

  • Anonymous
    April 17, 2012
    Hi and thanks for the post, it is a bit late "after 5 years" ! but found it useful, however, the vendor we've hired to do the SCOM deployment is handing over the project to us, and was looking for a command that dumps all SCOM configurations to verify his work, so, will the command above help in this task? Thanks again for your help and support!