Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Getting Error in Connection

ravitejainje
New Contributor
New Contributor

Hi All,

We are getting following error when we update CreateAccountJson

Error "Operation not allowed as you are entering a value that resembles or contains script code"
when we save and test connection,

When we execute script in postman it is working as expected and getting 200 OK response

Connection Name : On-Premise Exchange (REST)
Connection Type : Rest

JSON : 

{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "acctAuth",
"httpMethod": "POST",
"httpParams": "{\"Script\": \"\\$pass = convertto-securestring -String 'PASSWORD' -AsPlainText -Force;\\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist 'USERNAME',\\$pass;\\$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://removed.net/Powershell/' -Credential \\$mycred -Authentication Kerberos -AllowRedirection;Import-PSSession -Session \\$Session -DisableNameChecking -AllowClobber;\\$Alias = '${user.email}'.Split('@')[0];\\$AliasRetry = 1;while ((Get-Recipient -Filter {Alias -eq '\\$(\\$Alias)'}) -and \\$AliasRetry -lt 10) {\\$Alias = '${user.email}'.Split('@')[0] + \\$AliasRetry;\\$AliasRetry++};\\$PrimarySmtp = '${user.email}';\\$RemoteRoutingAddress = \\$Alias + '@acmehour.mail.onmicrosoft.com';\\$RemoteAddressRetry = 1;while ((Get-Recipient \\$RemoteRoutingAddress -ErrorAction Ignore) -and \\$RemoteAddressRetry -lt 10) {\\$RemoteRoutingAddress = '${user.email}'.Split('@')[0] + \\$RemoteAddressRetry + '@' + '@acmehour.mail.onmicrosoft.com';\\$RemoteAddressRetry++};\\$RemoteMailbox = Enable-RemoteMailbox -Identity '${user.email}' -RemoteRoutingAddress '${user.customproperty19}' -Alias ('${user.customproperty19}'.Split('@')[0]) -erroraction stop;if (\\$RemoteMailbox.PrimarySmtpAddress -ne '${user.email}') {Set-RemoteMailbox -Identity '${user.email}' -PrimarySmtpAddress '${user.email}' -EmailAddressPolicyEnabled \\$false};Set-RemoteMailbox -Identity '${user.email}' ${if(null!=user.customproperty29 && !''.equals(user.customproperty29)){return '-EmailAddresses @{Add=\\\\'' + user.customproperty29 +'\\\\'}'}else{''}} \"}",
"httpHeaders": {
"Authorization": "Token"
},
"httpContentType": "application/x-www-form-urlencoded",
"SuccessResponses": {
"": [
"Success"
]
},
"statusCode": [
null,
400,
401,
403,
404,
405,
409,
429,
500,
503
],
"unsuccessResponses": {
"responseMessage": [
"\"Failed\"",
"\"Powershell script taking too long Sample input: Invoke-Command -ComputerName \\\"SAVIYNTADSVCS\\\" -ScriptBlock {command to execute} -Credential \\$Cred\""
]
}
}]
}
 
ravitejainje_0-1724747547038.png

 


Need help on this

[This message has been edited by moderator to remove sensitive information]
1 REPLY 1

Dhruv_S
Saviynt Employee
Saviynt Employee

It sounds like you're encountering an error message related to an operation being blocked due to the presence of a value that resembles a script.

1. Ensure that the value you're entering doesn't contain any special characters or script-like content. This includes symbols such as <, >, or &, which can be interpreted as part of a script.

2. Ensure that special characters in the httpParams value are properly escaped.

3. Ensure that your JSON is correctly structured. Specifically, ensure that all quotes are properly escaped, and the JSON syntax is valid.

4. Please try to pass less number of arguments (only bare minimum needed) in httpParams, so that you can confirm which part of the argument is causing the problem.