I need to pass a SecureString variable value from a vRO input parameter to the Powershell host.
I've imported a powershell script using "Generate action from PS script". One of the variables is a securestring used for an authentication mechanism on the remote PS host. The value is inserted by the user when he starts the workflow in vRO (type SecureString).
It looks like this:
- User puts in a secure string in the presentation
- the workflow is executed and the value of the variable is used during the script execution on the PS host
- there it has to be used as System.Data.SqlClient.SqlCredential
Edit:
some more clarification. Part of the script hat to check if the SQL User credentials provided by the user can be used to connect to a MS SQL database:
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server = $strServer; Database = $dbname;"
$SqlCredential = New-Object System.Data.SqlClient.SqlCredential($loginAccount,$securePassword)
$SqlConnection.Credential = $SqlCredential
$SqlConnection.Open()
$securePassword must be passed through from vRO.
How could I achieve this? I unserstand the SecureString from vCO has to be decrypted - which key could I use? How do I convert the vRO SecureString input so that the PS host recognizes it as such?
Thanks!