This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dynamic Bound List Boxes using XML file

I'm trying to implement a Bound List Box following the guidance at the following link - https://support.oneidentity.com/active-roles/kb/139754/how-to-create-a-bound-list-box-with-4-levels  Hard-coding the possibilities in the script works but I would like to use an XML file as the source for the Level Possibilities.  The issue is that the values change periodically and we would rather update a source XML rather than periodically edit the script itself.  Has anyone modified the script provided in the KB to use an XML rather than hard-coding the values?     

Parents
  • I was trying to figure out something similar myself - but with CSVs - I also only had one choice at level 2 - but ended up doing it like this:

    function onGetEffectivePolicy($Request)
    {

    $Files = Import-Csv C:\list.csv

    $level1PossibleValues = $Files.Displayname

    $level1 = GetCurrentValue $Request 'edsvaLevel1'

    $level2PossibleValues = $Files | where {$_.Displayname -eq $level1 } | % description


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$level1PossibleValues)
    $Request.SetEffectivePolicyInfo('edsvaLevel2', $Constants.EDS_EPI_UI_GENERATED_VALUE, [string[]]$level2PossibleValues)


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'edsvaLevel1')
    #$Request.SetEffectivePolicyInfo('edsvaLevel3', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'eedsvaLevel2')


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_RESTRICTED , $true)
    $Request.SetEffectivePolicyInfo('edsvaLevel2', $Constants.EDS_EPI_UI_RESTRICTED , $true)

    }

    function GetCurrentValue($Request, [string]$AttributeName)
    {
    trap {continue}
    $value = $Request.Get($AttributeName)
    if($value -eq $null)
    {
    $DirObj.GetInfoEx(@($AttributeName),0) | Out-Null
    $value = $DirObj.Get($AttributeName)
    }
    $value
    }

Reply
  • I was trying to figure out something similar myself - but with CSVs - I also only had one choice at level 2 - but ended up doing it like this:

    function onGetEffectivePolicy($Request)
    {

    $Files = Import-Csv C:\list.csv

    $level1PossibleValues = $Files.Displayname

    $level1 = GetCurrentValue $Request 'edsvaLevel1'

    $level2PossibleValues = $Files | where {$_.Displayname -eq $level1 } | % description


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$level1PossibleValues)
    $Request.SetEffectivePolicyInfo('edsvaLevel2', $Constants.EDS_EPI_UI_GENERATED_VALUE, [string[]]$level2PossibleValues)


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'edsvaLevel1')
    #$Request.SetEffectivePolicyInfo('edsvaLevel3', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'eedsvaLevel2')


    $Request.SetEffectivePolicyInfo('edsvaLevel1', $Constants.EDS_EPI_UI_RESTRICTED , $true)
    $Request.SetEffectivePolicyInfo('edsvaLevel2', $Constants.EDS_EPI_UI_RESTRICTED , $true)

    }

    function GetCurrentValue($Request, [string]$AttributeName)
    {
    trap {continue}
    $value = $Request.Get($AttributeName)
    if($value -eq $null)
    {
    $DirObj.GetInfoEx(@($AttributeName),0) | Out-Null
    $value = $DirObj.Get($AttributeName)
    }
    $value
    }

Children
No Data