Return Script result to Web Site Form

I am setting up a ARS website form to click on a user and have a button that will run a script to build a string such as First letter of last name, first letter of first name etc.. and compile to a string. I have that ready in PS script ready. I want that script to run against the user chosen from the web site then return the value to the web site so the admin can use it.

Originally I created a virtual attribute and populated it for all users and that is easy to retrieve from the website but Security doesn't want that data to remains. We need it to be built as requested from the web site per user and returned and then cleared..

Kind of hard to explain but any ideas??

  • You should be able to implement something like this within an onGetEffectivePolicy function. The below code is not meant to be a fully working solution but to point you in the right direction with the help of the AR SDK. Ultimately, this should place the auto-generate button next to the attribute (just like the one next to samAccountName for generating its value if rules are in place) and the value will be calculated by the script and returned to the interface when that button is clicked.

    function onGetEffectivePolicy ($Request)
    {
    if ($Request.Class -ne "user") {return}

    # Attribute name
    $strAttrName = "edsvaString"

    $attrValue = Compute-String $Request

    $Request.SetEffectivePolicyInfo($strAttrName, $Constants.EDS_EPI_UI_DISPLAY_NOTE, "Attribute display notes")
    $Request.SetEffectivePolicyInfo($strAttrName, $Constants.EDS_EPI_UI_AUTO_GENERATED, $true)
    $Request.SetEffectivePolicyInfo($strAttrName, $Constants.EDS_EPI_UI_SERVER_SIDE_GENERATED, $attrValue)
    $Request.SetEffectivePolicyInfo($strAttrName, $Constants.EDS_EPI_UI_GENERATED_VALUE, $attrValue)
    }

    function Compute-String ($Request)
    {
    # Run some code here to generate the desired value, possibly based off of user attributes
    $value = <code>

    return $value
    }