Forum / Remote Desktop Manager - PowerShell Repository

Adding SubConnections at Import

  • Create an Issue
  • Cancel

Hey,

im currently expanding my selfmade import script for powershell and wanted to add subconnections. But i can't find out how to do it...

Currently im adding the main session like this:


$session = New-RDM-Session -Name $Name -Host $MachineName -Kind "RDPConfigured"
$session.Group = $Group
Set-RDM-Session $session -NoRefresh

$sessioncheck = Get-RDM-Session

If ($sessioncheck -match $session.id)
{
Set-RDM-Property -ID $session.ID -Path "MetaInformation" -Property "OS" -Value $OS -NoRefresh
Set-RDM-Domain -ID $session.ID -Domain $Domain -NoRefresh
Set-RDM-UserName -ID $session.ID -UserName $UserName
Set-RDM-Property -ID $session.ID -Property "ImageMD5" -Value $ImageMD5
Set-RDM-Property -ID $session.ID -Property "ImageName" -Value $ImageName

}

Now.. I want a Subconnection added to this entry. In this subject it would be the DELL iDRAC from the Server.
Can you help me out?

PS:
Is there a way to add the iDRAC Entry straight via the CMDlet? There is no choice for "iDRAC" in the -Kind parameter? As a workaround i am doing it via a template where i set the iDRAC session and use -Kind "undefined". Is there an easier way?

Thank you in advance.

Gregor

Clock4 yrs

Hello,

It is possible to add subconnections with the RDM PowerShell cmdlets. Because some cmdlets have been deprecated (New-RDM-Session, Set-RDM-Session, ...), I suggest to update them by their newest counterparts (New-RDMSession, Set-RDMSession, ...). Please consult our Online Help about PowerShell CmdLets Deprecated.

Now, the script for adding a subconnection to an entry, an iDrac connection type, would look like this :

$session = New-RDMSession -Name $Name -Host $MachineName -Kind "RDPConfigured"
Set-RDMSession $session

$iDracSub = New-RDMSession -Name $iDracName -Kind "iDrac"
$iDracSub.iDrac.Url = "http://your-url.com"
$session.Children += ,$iDracSub
Set-RDMSession $session

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Good Morning,

thanks for your help. Unfortunately i can't get your example script to work (see attachment)

Best regards,

Gregor

rdmv11errorcmdlet.JPG
Clock4 yrs

Hello,

Which version of RDM are you running?

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Hey,

we are using the Enterprise Edition Version 11.1.0.0.

Best regards,
Gregor

Clock4 yrs

Hello,

Which type of Data Source are you using?

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Hi,

we are using SQL Database. Currently based on SQL Server 2008 R2. In the future it will be SQL Server 2014.

Best regards

Clock4 yrs

Hello,

I was able to reproduce your issue with the version 11.1.0.0 and it has been fixed in the version 11.5.0.0.
Could you please upgrade your RDM to the version 11.5.4.0? You can download it here http://remotedesktopmanager.com/Home/Download!

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Hi,

it's working now, thank you!

Just another question. We will deploy this powershell import script to our users, so they can easily import their test environments.
In that case we need to register the RemoteDesktopManager.PowerShell.dll first. We did that in previous versions via the installutil.exe without problems.

As i did it manually for test now, i needed to unblock the .dll in the installation folder first. Do we need to do this on every client now?
Can you tell me (maybe a code example) what is needed to get the cmdlets to work properly?

Best regards,
Gregor

Clock4 yrs

Edit:

looks like it is working if we unblock the files first via: gci 'c:\Program Files (x86)\Devolutions\Remote Desktop Manager' | Unblock-File

But we get the following message at the first start (see attachment):

Do you know this warning?

Best regards,
Gregor

EDIT2:

Looks like it's just in an external Powershell, it can't load/find the registered the .dll. If i start it in RDM with the option "Load RDM CmdLet" it's working fine.
I could do it in this way too, is there a way to avoid people to edit the embedded script but they can still use it?

error1.JPG
Clock4 yrs

Hello,

About the warning, I am unable to reproduce it on our environment. Have you tried to use the -verbose parameters to get which file triggers this message?

About using an entry without been able to edit it, please refer to our Online Help about Security and also consult this tutorial video about Security Groups.

Using the RDM cmdlets in an external PowerShell is possible if the RDM CmdLet is properly loaded. Please refer to this post on our forum about it : https://forum.devolutions.net/topic24847-how-can-i-load-the-rdm-snappin-in-external-powershell-session.aspx.

Best regards,



Érica Poirier

signaturesignature

Clock4 yrs

Hey,

thanks. Looks like it was our error at the routine for loading the CmdLet. At the moment it's working fine.
Thanks for your help, much appreciated!

Best regards

Clock4 yrs