Create new RDM session

Create new RDM session

avatar

Hi,
I am trying to create new RDM sessions with a script that deploys servers.
But I am having trouble to create new entries with the service account.
I am using the service account to set the current datasource, that is working fine.

$datasource = Get-RDMDataSource -Name RVB
Set-RDMCurrentDataSource $datasource -Username "serviceaccount" -Password $ADPWord

But when I do the New-RDMSession it will not use the service account to create the entries but instead use the current powershell credentials.

$newsession = New-RDMSession -Type RDPConfigured -Host $server -Group "SERVRAR" -TemplateID $template.ID -Name $hostname -SetSession

How can I create the new session with a specific user account?
Kind regards,
Mattias

All Comments (3)

avatar

Hello,

Once the the session has been created, you can use the Set-RDMSessionUsername and Set-RDMSessionPassword cmdlets. And then you have to save again the session's updates with Set-RDMSession.

Let me know if that helps or if you need further information about it.

Best regards,

Érica Poirier

avatar

Hi,
The entry never gets created because it tries to create the entry with a user with no access to RDM.
The datasource is set up with the credentials for vll\domainjoin.
Set-CurrentDataSource is done with the username vll\domainjoin.
But when i run New-RDMSession it tries to create the new session with the current powershell credentials with no access to RDM.

Import-Module "${env:ProgramFiles(x86)}\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShellModule.psd1"
$User = "vll\domainjoin"
$ADPWord = ConvertTo-SecureString -String "password" -AsPlainText -Force
$MyCredential=New-Object -TypeName System.Management.Automation.PSCredential `
-ArgumentList $User, $ADPWord

$datasource = Get-RDMDataSource -Name DPSvmdomainjoin
Set-RDMCurrentDataSource $datasource -Username "vll\vmdomainjoin" -Password $ADPWord
#Get-RDMCurrentDataSource
#Get-RDMSession

$template = Get-RDMTemplate | Where-Object {$_.Name -like "RDP Session - Domänansluten Server"}
$server = "vs1155.vll.se"
$system = "RPA utvmiljö"
$hostname = "$server ($system)"

$newsession = New-RDMSession -Type RDPConfigured -Host $server -Group "SERVRAR" -TemplateID $template.ID -Name $hostname -SetSession

avatar

Hello,

What RDM version are you using?

According to your script, I presume you are connected to Devolutions Server. What version are you using?

I think I have found something. I was able to reproduce a problem which gave me a Connection has invalid group specified error. I have solved it by removing the group set in the Folder parameter of the template.

Could you please check if a folder is set in the template you are using in your script? If so, please remove it and try again.

forum image

If you still have an issue, please send an email to ticket@devolutions.net with this topic as a reference and we will send you a link to book a troubleshooting session.

Best regards,

Érica Poirier