Move a Server group and all children to another folder

Move a Server group and all children to another folder

avatar

Hi

As the title says I'd like to move a server and its connections into a different folder. Is there a powershell command to do this easily?

The issue I have is that I create a server using a template as so:
$session = New-RDMSession -Name "TestCustomer1" -Group "Customers\Test1" -TemplateID "99d11076-8e4e-468c-ae14-badc08affb54" -Kind "TemplateGroup" Set-RDMSession $session -Refresh;

But it seems to ignore the -Group flag and places it at the root in the navigation hierarchy, just below the main server node. The template places things as expected if I right click on the Customers folder and choose Add-> Add From Template, but not when done via powershell.

So, is there a second command I can run after creating my server session?

Thanks!


Update: After creating, clickiong and dragging the new server into the folder does exactly what I want, however I will be making a great deal of these and it would be awesome if there was just a command I could run after each creation. So, basically I want to mimmic the click and drag method via powershell

All Comments (5)

avatar

Did you include the ; for the syntax, or break this up into 2 lines?

$session = New-RDMSession -Name "TestCustomer1" -Group "Customers\Test1" -TemplateID "99d11076-8e4e-468c-ae14-badc08affb54" -Kind "TemplateGroup"
Set-RDMSession $session -Refresh

David F.

avatar

Yeah I execute those as 2 lines, copy paste error in my post sorry, will fix.
If it makes a difference I'm still running 11.6.2.0, but we should be upgrading to 12 very soon. Not sure if that makes a difference with this or not.

avatar

As a current work around I've done the following:
1) create the new session from template
2) set the $session[0] (the parent)
3) update the $session[0].Group to desired path
4) Set $session[0]
5) set all the child element groups as so: $session[1].Group to desired path including name of the parent
6) Set-RDMSession $session -Refresh
7) create a new session with equivalent name and group to what parent should be
8) $session.GroupDetails.GroupType="Server" (to make it a server)
9) set the custom fields on said server that are needed (they get lost when session is recreated without a template)
10) Set-RDMSession $session -Refresh

And I get the desired outcome. This is of course ridiculous to have to do as it's recreating what I understand is exactly what a template is meant to do, but at least it's functional for now.

My desire would be this:
1) create the new session from template and set
2) some command to move the whole session to another folder group

avatar

Hello,


We have been able to reproduce your issue and a ticket has been submitted to our engineering department.


As a workaround, remove the -Group parameter and add the destination group folder in the value of -Name parameter.

$session = New-RDMSession -Name "Customers\Test1\TestCustomer1" -TemplateID "99d11076-8e4e-468c-ae14-badc08affb54" -Kind "TemplateGroup"

Best regards,

Érica Poirier

avatar

Awesome, putting the path in the name instead of using the -Group flag worked!

Thanks!