Forum / Remote Desktop Manager - PowerShell Repository

New group from template group

  • Create an Issue
  • Cancel

I've created a structured group and saved that as a shared group template.
In order to automate the creation of 1000 new groups based on that group template I want to employ the cdmlets and figured I could use the -TemplateID option.

This creates a new group:
$session = New-RDMSession -Kind Group -Name "test2" Set-RDMSession $session -Refresh

But when I add the TemplateID as such:

$session = New-RDMSession -Kind Group -Name "test22" -TemplateID "5e968c78-86e0-4618-a8b1-73dcfc4639bd" Set-RDMSession $session

A new group is created, containing one session with the same name but a red circle with an I for an icon.

I figured it may have something to do with the fact that this is a Shared template but I get the same result when I choose a local templategroup.
I also notice that it is not possible to export and import a template group. On import it will become a standard session (no groups)

Then I tried to create the group based on the Kind TemplateGroup but this created just the faulty session and no groups at all.

Am I missing something?
edited by rolflobker on 5/8/2015

Clock5 yrs

Hi,

Can you export your template you are using for your cmdlet and send it to me via private message?

Is it possible to have a screenshot of the session with the red circle and an I for icon?

Can you also try your cmdLet in the embedded PowerShell in RDM? You can find it in the Tools tab in the rubban.

Finally, what version of RDM do you use and on what type of datasource do you apply your cmdLet?

Best regards,

Olivier Désalliers

signaturesignature

Clock5 yrs

Found a bypass by creating a new datasource. Filling it with folders in the the root and then exporting to RDM. Afterwards import into seperate groups by using:

foreach ($Customer in Get-Content K:\Temp\Customers.txt) {
Import-RDMSession -Path K:\Temp\content.rdm -DuplicateAction "Add" -Group "Customers\$Customer"
}

Figured that the red icon is like a placeholder for the normal icon. Also encountered that during the above import but after opening a sessions all icons were properly displayed.

Regarding the template group. I personally gave up on that but will elaborate since documentation seems unclear on how this works and this does appear like a bug.

EDIT: I found than the Template Group was changed to a Single RDP session when exported. I suspect that this also happens when I try to create a new group from this templategroup. On import, in templates, the imported template differs from it's export.
When I create a TemplateGroup and do Get-RDMTemplate it's type is blank. On ex- and import or when used by New-RDMSession -Template it will become of type Remote Desktop Connection (RDP)

So this seems like a likely cause: It appears that TemplateGroup may not be used as Templates?
I wanted to achieve the same as when I Add from template where RDM will ask for a new name.

If you want to replicate do not import the .rdm but create some folder structure and rightclick parent > Create template group

Cmdlets were used in the embedded shell.
Version is 10.5.4.0
Datasource was SQLlite.

Template exported as .rdm attached (does not contain sensitive data)


I imported the above RDM as a new local template called 'GroupTest'

Then ran:

PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMTemplate

TemplateName ID Type Source
------------ -- ---- ------
GroupTest e788bb26-fb15-4673-8aba-5c82977a35d8 Microsoft Remote Desktop (RDP) Local

PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> $Template = Get-RDMTemplate
PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> $template

TemplateName ID Type Source
------------ -- ---- ------
GroupTest e788bb26-fb15-4673-8aba-5c82977a35d8 Microsoft Remote Desktop (RDP) Local

PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> $session = New-RDMSession -Group Test -Name Test -Kind Group -TemplateID $Template.ID
PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> Set-RDMSession $Session -Refresh
PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSession

PS K:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSession
Name Group ID Session
---- ----- -- -------
Test Test 3bc509ce-bd42-4478-8638-f1d942483b13 Test\Test

Now I have a group called Test and within it one session called Test which appears to be an RDP session. No folderstructure.

Screenshot:
image
edited by rolflobker on 5/11/2015
edited by rolflobker on 5/11/2015

TemplateGroupTest.rdm
2015-05-11 19_12_22-Remote Desktop Manager [PowerShell (RDM CmdLet)].png
Clock5 yrs

Hi,

There will be a fix in the next release with the New-RDMSession and Set-RDMSession cmdlets to be able to use them with a template group.

Here's a sample:

New-RDMSession -Name "rolflobker" -Kind "TemplateGroup" -TemplateID e788bb26-fb15-4673-8aba-5c82977a35d8 | Set-RDMSession -Refresh

You will also have a fix for the import and export template group.

Best regards,

Olivier Désalliers

signaturesignature

Clock5 yrs