This should work from TSX at some point, but I can not get it working at this time.
/usr/local/microsoft/powershell/6.0.0-alpha.16/powershell -NoProfile -NoExit -Command "Enter-PSSession -ComputerName '$URI$' -Credential (New-Object System.Management.Automation.PSCredential('$EffectiveUsername$',(ConvertTo-SecureString $EffectivePassword$ -AsPlainText -Force)));"
can you please open a support ticket here https://support.royalapplications.com/support/tickets/new and provide some details (version, screenshots, etc.)
We're having trouble getting this to work as well; currently we're getting an "invalid computername".
It looks like the tokens aren't being passed properly to PowerShell.
Here's what we have for the "arguments" box:
-NoProfile -NoExit -Command "$username = '$EffectiveUsername$';$password = ConvertTo-SecureString '$EffectivePassword$' -AsPlainText -Force;$Credential = New-Object System.Management.Automation.PSCredential($username,$password);Enter-PSSession -ComputerName '$URI$' -Credential $Credential"
as mentioned above, it would be better to open a support ticket and send us a sample document with the configuration of your powershell task.
Jan Egil Ring
Go to Templates->Add New Template->External Application and enter the following:
Display Name: PowerShell Remoting ($URI$)
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Arguments: -NoProfile -NoExit -Command "$username = '$EffectiveUsername$';$password = ConvertTo-SecureString $EffectivePassword$ -AsPlainText -Force;$Credential = New-Object System.Management.Automation.PSCredential($username,$password);Enter-PSSession -ComputerName $URI$ -Credential $Credential"
Working Directory: C:\Windows\System32\WindowsPowerShell\v1.0
This makes it possible to right click a connection object, choose Connect using Template->PowerShell Remoting in order to open a PowerShell Remoting session against that machine and be automatically authenticated using the credentials from the connection object.
4 people like this idea