Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Unrecognized character escape Error while Executing Script via REST connetor

PratikPokale
New Contributor
New Contributor

We've installed the Saviynt IIS Agent on the IIS server to execute commands on the Exchange server through Saviynt. We configured a REST connector to execute the script on the IIS server and set up the Security System, Endpoint, and Rules to create the task. Once the task is created, we run the provisioning job.

After provisioning job runs we faced the following Error:
{"auditDetails":"call1":{"message":"Unrecognized character escape 's' (code 115)\n at [Source: {\"SCRIPT\": \"$password = '<Real_Password>'| ConvertTo-SecureString -AsPlainText -Force; $psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ('<Real_Username>', $password); $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://<ExchnageServerHostname>/powershell/' -Authentication Kerberos -Credential $psCred; Import-PSSession -Session $session -DisableNameChecking -AllowClobber; Enable-RemoteMailbox -Identity '########' -RemoteRoutingAddress '##########' \"}; line: 1, column: 182]","status":"Failed"}}

Could you please guide us, how can we resolve this Issue?

We are using the following JSON in the REST Connector:
Connection JSON:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://<IIS Server Hostname>/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"exchUser": "<Username>",
"exchPassword": "<Password>"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"echUser": "<Username>",
"echPassword": "<Password>",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic ABCD",
"apiRateLimitConfig": {
"retryAfterCalls": 100,
"retryWaitSeconds": 60
}
}
}
}

Script Execute JSON:
{
"accountIdPath":"accountName",
"responseColsToPropsMap":{

},
"call":[
{
"name":"call1",
"connection":"acctAuth",
"url":"https://<IIS Server Hostname>/SaviyntApp/PS/ExecutePSScript",
"httpMethod":"POST",
"httpParams":"{\"SCRIPT\": \"\\$password = \\'${connection.echPassword}\\'| ConvertTo-SecureString -AsPlainText -Force; \\$psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ('${connection.echUser}', \\$password); \\$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://<Exchnage Server Hostname>/powershell/' -Authentication Kerberos -Credential \\$psCred; Import-PSSession -Session \\$session -DisableNameChecking -AllowClobber; Enable-RemoteMailbox -Identity '##########' -RemoteRoutingAddress '###########' \"}",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json",
"successResponses":{
"response[9].Objectreturned":[
"Success"
]
},
"unsuccessResponses":{
"response[9].Objectreturned":[
"Failure"
]
}
}
]
}

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/identity-governance/pass-dynamic-values-exchange-connector/m-p/77172#M...


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.