Forum / Remote Desktop Manager - PowerShell Repository

Creating new RDMSession and then setting seesion details?

  • Create an Issue
  • Cancel

I can create a new session with the following code. But then the session.id fails to let me add details to the connection?


# Create Server entry
$session = New-RDMSession -Kind RDPConfigured -Group $GroupPath -Name $FQDNHostName -Host $FQDNHostName
Set-RDMSession $session

# add Server entry property details
Write-Host "Setting connection details"
Set-RDMSessionProperty -ID $session.ID -Property "HostDomain" -Value $Domain.Name



Thanks, Stu

Clock4 yrs

Hello,

The cache is used and the session isn't there yet. Sadly the only recourse at this time is to call Update-RDMUI which slows downs scripts significantly if you are doing this in a loop.

We will rewrite our snapin into a module in the future, I suspect we will not fix this issue before then.

Sorry about that,



Maurice Côté

signaturesignature

Clock4 yrs

This is working and appears to be what I need for my current scenario:

# Create Server entry
$session = New-RDMSession -Kind RDPConfigured -Group $GroupPath -Name $FQDNHostName -Host $FQDNHostName

# add Server entry details
$session.HostDomain = $Domain.Name
$session.UserName ="is{%UserName% + '-ETG'}"
$session.KeyboardHook = "OnTheRemoteComputer"
$session.UsesHardDrives = $false

Set-RDMSession $session

Clock4 yrs