Windows Remote Connection from UiPath

we are trying to execute PS scripts on remote server from UiPath. Script is working fine on powershell command prompt of source server. but not working in UiPath.
please support on this issue.

From command Promt:
Source Server : 44.XXX.XX144
Target Server : 184.XX.XXX.35

Erron in UiPath: "Invoke Power Shell: Cannot process argument transformation on parameter ‘Credential’. userName",

Script:
param(
[String]$username,
[String]$pass,
[String]$computername
)

[securestring]$password = ConvertTo-SecureString -String $pass -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)

Invoke-Command -ComputerName $computername -Credential $psCred -ScriptBlock {Get-Culture}

@B_H_Divya_Cognizant

Can you share what you are passing in Parameters?

are you passing password as a string? Because the TypeArgument you are passing as String

Hope this may help you

Thanks,
Srini

Hi Srini,

thanks for your response. I am passing as secure string. Fetching values from Orchestrator.

@B_H_Divya_Cognizant

Can you pass that as a string and try?

Thanks,
Srini

@B_H_Divya_Cognizant

Try as below

new System.Net.NetworkCredential(string.Empty, PASS1).Password

Thanks,
Srini

Still same error Srini.

i have tried this option as well. Still same error. {
“message”: “Invoke Power Shell: Cannot process argument transformation on parameter ‘Credential’. userName”,
“level”: “Error”,
“logType”: “Default”,
“timeStamp”: “16:28:20”,
“fileName”: “Main2”,
“processVersion”: “1.0.0”,
“jobId”: “99ed33d0-63fe-4eb6-9692-43c261223716”,
}

UiPath team suggested below validation.

execute this script in the window-legacy project compatibility solved my issue.

Could you please check the below pointers and let us know the outcome of it:

  • Can you please share the UiPath studio version and UiPath.System.activities package version?
  • Can you please execute this script in the window-legacy project compatibility and validate the issue?
  • Can you please upgrade the UiPath.System. activities to the latest version and validate the issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.