Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/29/2024 05:23 AM
Hello Team,
I created a WINPS connection to be able to execute powershell scripts from a remote machine.
Below is the CREATEACCOUNTJSON:
{
"CREATEACC": [
"Script=
$pw=convertto-securestring '${PSSCRIPT_PASSWORD}' -asplaintext -force;$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist 'user',$pw;Invoke-Command -ComputerName 'remotemachine.com' -Credential $mycred -ScriptBlock {C:/PSScript1/test.ps1 }"
],
"SuccessResponses": {
"OBJECTTOREAD": "get(0).PSShowComputerName",
"SUCCESSVALUE": "True"
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
}
}
Using the JSON like this, I always get java.lang.RuntimeException: Failed : HTTP error code : 500. If the password is in clear text in JSON, the powershell script is executed correctly, but the task still fails. with "Error creating account"
My questions are:
- how to pass the password in JSON and not be in clear text and the script to be executed successfully
- why the task is failing if the script is executed successfully on the remote machine?
Forum post read:
CreateAccountJSON in WINPS connector - Saviynt Forums - 23835 (did the format of JASON like this; still fails with HTTP 500)
WINPS -NEW Account Task is Failing - EnableMailBox - Saviynt Forums - 73189
How to trigger Script_To_Execute in WinPS connecti... - Saviynt Forums - 68227
Thank you!
07/29/2024 07:50 AM
Could you kindly provide a detailed snapshot of the information extracted from the logs, encompassing errors and other pertinent functionality details encountered during the execution of this process? Your assistance in furnishing this information would greatly aid in the analysis and resolution of any issues .
‼️‼️⚠️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.⚠️‼️‼️
07/29/2024 08:03 AM
07/29/2024 08:08 AM
07/29/2024 08:20 AM
Hi,
How and where should this parameter be defined so it can be taken correctly in the credential string and not to be in clear text? Is not the same with ?
Thank you!
07/29/2024 08:32 AM
07/29/2024 08:55 AM
Yes, for REST connector I could do it and working properly. But I wanted to know how to mask the password in WINCONNECTOR - CREATEACCOUNTJSON.
Thank you
07/29/2024 11:44 AM