Home Self-Service Portal - Community

Relationship properties

Hi Team,

I tried something for see the incident class properties with the below command and it is working fine.

$IC=get-scsmclass -name system.workitem.incident$

$IC.getproperties("recursive") --> This command retrieves almost all of the fields for the incident module with few columns as (Name, Key, Required, AutoIncrement, Type and DisplayName)

Similarly, I tried to get the "affecteduser" using Relationship class. I used the below commands. Unfortunately, it did not work.

$RC=get-scsmrelationshipclass -name system.workitemaffecteduser$

$RC.getproperties("recursive") --> This is not working

Could anyone please let me know what was wrong in the above command?

Appreciate your help!!!




  • Options
    Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    I just wrote something similar to this. There may be an existing method, but I couldn't find it. So this is what I did:

      $className = "system.workitem.incident$"

      $wiClass = Get-SCSMClass -Name $className

      $extensions = $wiClass.GetDerivedTypes()

      $properties = New-Object System.Collections.ArrayList


      foreach ($e in $extensions) {

        $subClass = Get-SCSMClass -name $e.Name

        $props = $subClass.getProperties()




  • Options
    Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    I thought immediately after posting that this would be pretty useful wrapped as a function. So I quickly wrote one and did a quick test again using the incident class:

    function Get-ClassProperties {





      $properties = New-Object System.Collections.ArrayList

      $ClassToGetPropsFor = Get-SCSMClass -Name $className

      $extensions = $ClassToGetPropsFor.GetDerivedTypes()

      if ($IncludeBaseClass) {

        $baseTypes = $ClassToGetPropsFor.getBaseTypes()

        foreach ($type in $baseTypes) {





      foreach ($extension in $extensions) {

        $subClass = Get-SCSMClass -name $extension.Name

        $props = $subClass.getProperties()



      return $properties


    Get-ClassProperties -ClassName "System.Workitem.Incident$" -IncludeBaseClass

Sign In or Register to comment.