Custom Trigger returning data with Powershell

Custom Trigger returning data with Powershell

Hi,

I've got a powershell script that gathers mainly 2 types of information, and now I want to return these data to the servicedesk. The script so far looks like this:

param (

$json = "none"

)


$jsondata = Get-Content $json -Encoding UTF8 #Encode if necessary

$obj = ConvertFrom-Json $jsondata

$requester = $obj.request.REQUESTER

$description = $obj.request.description

$folder = $obj.request.Mappenavn


$sdphost = "path to our servicedesk"

$techkey = "API key"


I get the data from the obj.request-variables, so that part works fine. Now never mind what the script does in between. Facts is I end up with two new variables ($NewRequesterName and $NewFolderName (custom fields in our form)), and I want to return these two values to the ServiceDesk request. Do I override the $requester and $folder variables and then simply make a "return" of the data with a simple command, or is it more complex?


I hope someone can help us out.

/Rasmus

                  New to ADSelfService Plus?