SCOM – Get values from your own built extended class with powershell


You want show or use values from your own extended classes in SCOM with powershell?

Yes you can, this is possible with the following powershell commands.


First you must declare your extended class. In my scenario I take the SCOM class “Windows Computer”. The new extended class are named “Windows Computer Extended Attributes”. Now, I filled up the extended class with a lot of data from monitored Windows and Linux computers.  As example; Server function, server type, server team membership and a lot of other important data from registry and WMI. You can now filter, sort and group the monitored objects dynamically in SCOM with the data from the extended class.

Also, you can get the values with powershell and create some other great scripts.

The powershell commands

To get the SCOM class instance (extended class) you must declare first the extended SCOM class.

$Class = Get-SCOMClass | WHERE {$_.Displayname -eq "Windows Computer Extended Attribute"}

Now you can get the SCOM class instance (extended class). The command “Get-SCOMClassInstance” shows a large amount of data. I restrict the result with a monitored object, in this case I take a monitored Windows server. The Displayname must match exactly the Displayname from the monitored object, in my case the FQDN “”.

$SCOMExAttr = Get-SCOMClassInstance -Class $Class | WHERE {$_.Displayname -eq ""}

To figure out the value names to be used, you can export the SCOM class instance to a text file or something else.

$SCOMExAttr = Get-SCOMClassInstance -Class $Class | WHERE {$_.Displayname -eq ""} | Format-List * >>C:\temp\

In the exported List, you can find the values that you need. You can see default values from the base class that you extended and the own values (imported attributes).

The following value names are relevant to continue with the powershell script. The value names in your own extended class have for all monitored objects the same UID.

  • Server function:
  • Server type:
  • Active Directory Site:

To get the values use the subsequent powershell command

$ | % {if($_.Name -like "*AttributeDiscoveryGeneratedByUI843f4fa102e24b2791be3ccce9441e92*"){$_.value.value}}
$ | % {if($_.Name -like "*AttributeDiscoveryGeneratedByUIc16fe093d54846159a5f620545143277*"){$_.value.value}}
$ | % {if($_.Name -like "*ActiveDirectorySite"){$_.value.value}}


The script displays the following output. You can use this output to fill the custom fields from SCOM alerts and create some custom notifications.




Leave a Reply