Start a new topic
Answered

Specify Name for Ad Hoc connection

As part of some automation, I'm creating a connection via the cli:

   

rtscli.exe action connect-adhoc --scheme rdp --uri $ip

  The machine has no name, only an IP address which is essentially meaningless. 
But I do need to assign a name so I can distinguish between one connection and another.

I can right-click on the connection in the UI and change the Display Name.

Is it possible to set the display name via the connect-adhoc action? I'm not seeing an option in the --help.


Best Answer

Hi Chris,


you can use the --property=VALUE to set specific properties:

https://docs.royalapps.com/r2021/royalts/advanced/cli.html#arguments-and-options


You can find a list of all properties for each object here:

https://docs.royalapps.com/r2021/scripting/objects/index.html


An example for the name property:

https://docs.royalapps.com/r2021/scripting/objects/connections/royalrdsconnection.html#name


--property="Name":"Some Name"


Let me know if this helps.


Regards,
Stefan


Answer

Hi Chris,


you can use the --property=VALUE to set specific properties:

https://docs.royalapps.com/r2021/royalts/advanced/cli.html#arguments-and-options


You can find a list of all properties for each object here:

https://docs.royalapps.com/r2021/scripting/objects/index.html


An example for the name property:

https://docs.royalapps.com/r2021/scripting/objects/connections/royalrdsconnection.html#name


--property="Name":"Some Name"


Let me know if this helps.


Regards,
Stefan

Hi Stefan - 
That worked great! Thank you!!

Glad to hear that. You are very welcome!

A bit more about my scenario so you can understand the impact RoyalTS has had for me.

Naming the VM was just icing on the cake, but the ability to automatically create a new connection and login automatically from the command line dramatically reduces my development inner loop.
I'm working on a fairly complex automation project. We have a provisioning process that runs for about 17 minutes to create some cloud resources, then we need to login to a VM where a script runs to complete installing apps, setting up nested VMs, installing kubernetes, etc, etc, etc. The second part of the process can take about 60 minutes. 

It used to be that I had to wait for the cloud provisioning to complete, notice it was done and then manually login to the VM. Now, with RoyalTS, I can string the provisioning command together with the RoyalTS command, which lets me run a single command at the CLI to start the process and walk away, knowing that the second step of the process will start as soon as the first is complete - a huge improvement!


Thank you!

Login or Signup to post a comment