Start a new topic
Answered

Creating PuTTY connections using the 'existing connection' feature

I was very happy to find the 'Existing Connection' feature for using PuTTY connections (https://support.royalapps.com/support/discussions/topics/17000015877/page/1). I'm having trouble figuring out how to create them in a Dynamic Folder.


I have my Dynamic Folder script successfully creating connections, but they are showing up as ordinary SSH connections instead of the 'Existing PuTTY Connection' type. I tried creating a connection by hand and using the RoyalDocument Powershell module to look at it then replicating the ConnectionType property, but it doesn't seem to have any effect.


Here is my Powershell object creation portion of my script. Each object is converted into JSON at the end of the script.


    [pscustomobject]@{
        Name = $name
        ComputerName = $h
        Type = 'TerminalConnection'
        ConnectionType = 'putty;Existing Putty Session'
        PuttyConnectionName = 'Default%20Settings'
    }

I'm hoping that there is something simple I am missing to change the connection from the default type to 'Existing PuTTY Connection'.


Thanks in advance!


Best Answer

Hi!


Check out the "Advanced Scenarios" section in the Royal JSON documentation.

https://www.royalapps.com/go/rjson-documentation


You can use the "Properties" json element to specify additional properties. To find out which properties are available for each object type, go to:

https://www.royalapplications.com/go/help-ts-scripting-objectproperties


The output json should look like this:

 

{
    "Objects": [
        {
            "Type": "TerminalConnection",
            "Name": "some name",
            "ComputerName": "some ip",
            "Properties": {
                "ConnectionType": "putty;Existing Putty Session",
                "PuttySessionName": "Default%20Settings"
            }
        }
    ]
}

 


Answer

Hi!


Check out the "Advanced Scenarios" section in the Royal JSON documentation.

https://www.royalapps.com/go/rjson-documentation


You can use the "Properties" json element to specify additional properties. To find out which properties are available for each object type, go to:

https://www.royalapplications.com/go/help-ts-scripting-objectproperties


The output json should look like this:

 

{
    "Objects": [
        {
            "Type": "TerminalConnection",
            "Name": "some name",
            "ComputerName": "some ip",
            "Properties": {
                "ConnectionType": "putty;Existing Putty Session",
                "PuttySessionName": "Default%20Settings"
            }
        }
    ]
}

 

The Properties object was what I was missing. I updated my PS script to set Properties to a nested PSCustomObject with keyvalues as you mentioned. It works like a charm. Thanks much for your quick response!!!

Glad I could help.


cheers,
Stefan

Login or Signup to post a comment