username / password to login via powershell

username / password to login via powershell

avatar

Hey,
i am trying to automate sessions via VRA into RDM, however i think i am having a problem with doubel login:
from VRA > powershell host > into RDM.

from VRA i am invoking a powershell script which is fed certain parameter (hostname, description and so on). but is it also possible to add the credentials to login to the datasource?

All Comments (3)

avatar

Hello,

It is possible to update the Username and Password properties on an existing data source in RDM through PowerShell.

Import-Module RemoteDesktopManager.PowerShellModule

$ds = Get-RDMDataSource -Name 'YourDataSourceNameHere'
$username = "MyUsername"
$passwd = "MyPassword"
Set-RDMDataSourceProperty $ds -Property "User" -Value $username
Set-RDMDatasourceProperty $ds -Property "Password" -Value $passwd
Set-RDMDataSource $ds
Set-RDMCurrentDataSource $ds


Best regards,

Érica Poirier

avatar

Hello,

As additional information, you can also use this method to connect on a data source while providing the credentials through a script. Please replace the ID in the following sample with your data source ID you can get when editing the data source.

forum image

$username = "UsernameHere"
$passwd = ConvertTo-SecureString -AsPlainText -Force "YourPasswordHere"
Set-RDMCurrentDataSource -ID '4930A41C-D6D3-4C04-8950-AAD931AACAEA' -Username $username -Password $passwd


Best regards,

Érica Poirier

avatar

Hi Erica,

thanks for your update i will take a look this week, i didnt manage to get it to work with the first solution yet.