and more in a single search tool across platforms. Read the announcement here. |
02/14/2023 03:10 PM
Hello Forum,
We are using WINPS connector to integrate Exchange with Saviynt. The CreateAccount task is failing with error as below but we can see that the powershell script executed successfully and able to see the account in Exchange. And we are not able to see any account under Users in Saviynt.
'ERROR services.WindowsConnectorService - Error occured while creating account -JagadeeshD\n","stream":"stdout"'
We do not have any entitlements under Exchange endpoint.
CreateAcc JSON:
{
"CREATEACC":["Script=Invoke-Command -ComputerName 'localhost' -FilePath <<file path of the script>> -argumentlist <no.of arguments as input parameters>;"],
"SuccessResponses" : ["Objectreturned"]
}
We have tried below as well but still same issue.
"SuccessResponses" : {"OBJECTTOREAD":"get(0).PSShowComputerName","SUCCESSVALUE":"True"}}
Any leads would be much appreciated.
02/15/2023 02:02 AM
Please try using following json:
{"CREATEACC":[
"script=$pw = convertto-securestring '${PSSCRIPT_PASSWORD}' -asplaintext -force;$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist 'XXXXX\\XXXX',$pw;Invoke-Command -ComputerName 'XXXXXX' -Credential $mycred -ScriptBlock {C:\\XXXX\\XXXX.ps1}"],"SuccessResponses" : ["Successful"]}
For more details please refer to following document :
CREATEACCOUNTJSON
02/15/2023 03:04 PM
Hi Rakesh, thank you for your response.
We have tried with below setting but no luck.
"SuccessResponses" : ["Successful"]}
02/27/2023 03:45 PM
I have tried with this but still the task is not getting auto completed.
"SuccessResponses" : ["Success","success","SUCCESS","0", "true","True","TRUE"]}
What will be the response from WINPS connector to confirm that the request is successful.
02/27/2023 04:01 PM
Hi @jdoma,
Usually, when PS Script runs successfully, it does not provide any response.
Hence the response provided by the connector usually starts with "No result returned".
If you do not expect results too for successful response, you can try below JSON :
{"CREATEACC":["Script=ExecuteMyScript.ps1"],"SuccessResponses" : "No results returned"}
Note : if you retrieve any different message from your script, the task won't get completed as PS Script returns a message.
Hope this helps !
02/27/2023 09:18 PM
Hi Adrien,
Thank you, its moving the request to Completed List but how do we handle if any error occurs while webservice call. We are trying to place powershell script with in Saviynt connection jsons. I have tired to use try-catch blocks but its not allowing under script block. Any suggestions will be appreciated.
02/28/2023 07:43 AM
Hello @jdoma,
You can use Try / Catch Powershell script in Saviynt JSONs.
Below is an example built on Create Account that checks if account already exists on target AD. If Yes, it will enable the account. Otherwise it will create a new one.
Hope this helps !
02/28/2023 02:31 PM
Thanks for the sample json, it was a great help. And if any exception occurs during the script execution, will that be printed in Saviynt logs. If not, how can we print a proper error message with in Saviynt logs.
03/02/2023 02:08 AM
Hello @jdoma,
Exceptions raised during your PS Script will be for sure caught in Saviynt logs.