Start a new topic
Not Taken

Possibility to specify secure gateway on Dynamic folder

Currently it's not possible to specify Secure gateway for dynamic folders. You can only make connection objects inherit Secure gateway settings from parent folder. But this doesn't really help since you can't specify it for dynamic folders.


Hi Jim,


you are right, you can't assign a secure gateway to the dynamic folder but you can configure the secure gateway (which can be either created dynamically or statically in a separate doc) on the dynamic connections inside your dynamic folder using the script. You can actually access all the properties of each object in the script

In the documentation (https://www.royalapplications.com/go/kb-all-royaljson) PDF, search for "Advanced Scenarios"). You can find all available properties of each connection here: https://content.royalapplications.com/Help/RoyalTS/V5/index.html?scripting_objectproperties_royalrdsconnection.htm


Let me know if this helps.


Regards,
Stefan

Hi Stefan,


Yes it could be done in that way, but it would be nice to keep code as generic as possible. For example now I'm creating connection objects which inherit credentials from parent folder. Which is really nice since i don't have to customize code for every time when i need to import new set of connection objects or change credentials in imported objects.


Of course as a work-a-round i could check if custom property called "SecureGateway" is set, if it is; use it.

But to be consistent with normal folders and how credentials are working, this would be nice to have.

Hi Jim,


to be honest, adding this option may be even more confusing. The credentials of a dynamic folder do work differently because these credentials are intended to be used in the script to authenticate to the backend system - not for the connections created by the script. I personally think that letting the script configure the secure gateway options for each connections is the better approach as the sole connection configuration is controlled by the script and not by configuration "outside" of the script.


Regards,

Stefan

I too would like the ability to set the secure gateway on the dynamic folder. This would allow use to avoid having to know what the secure gateway is on the application that is generating the dynamic folder's JSON and would resemble how folders work more accurately.

Hi Ryan,


as mentioned before: from a UI/UX perspective it's very confusing because this would be the only page which would directly affect the objects generated by the dynamic folder script. I still recommend to set the appropriate properties through the script. Your specific use case is also supported. You can set the ID of the secure gateway to point to a secure gateway outside the dynamic folder script.


Regards,
Stefan

Hi Stefan,


Thanks for your response. Whilst I can set the security gateway ID via the script, it requires manual entry of this ID somewhere. As my data source is an API I would need to pass that security gateway ID to it (probably via query string or in the request body). I was hoping I could have 1 dynamic folder script that i could use for all customers (different documents, security gateways etc) and then just update the API URL for them.

For the moment I will pass the security gateway to the API via the request.

Best,
Ryan

I can't seem to set the SecureGateway details via the below script. I've been playing with syntax for a while but just cant get it to work: 


            New-Object -TypeName System.Management.Automation.PSObject -Property @{

               "Type" = "RemoteDesktopConnection";

               "Name" = $computer.name;

               "Computername" = $computer.name;

               "CredentialName" = "cred";

               "Description" = $computer.description;

               "Path" = $computer.canonicalname.replace("/$($computer.name)", "");

               "SecureGatewayName" = "Gateway";

               "SecureGatewayUsageMode" = 1;


Note the remote desktop record is created fine. Just missing the gateway config. 

Hi Jake,


The Secure Gateways properties can only be set via ID's and not via name.


Dynamic folders use rJSON properties: 

https://docs.royalapps.com/r2021/scripting/rjson/available-properties/royaljsonobject.html


To access properties outside the rJSON format (which is not recommended, unless you know what you're doing), you would have to access the RoyalDocument properties:

https://docs.royalapps.com/r2021/scripting/rjson/advanced-scenarios.html


Both of your mentioned properties can be set directly via rJSON:

https://docs.royalapps.com/r2021/scripting/rjson/available-properties/royaljsonobject.html#securegatewayid

https://docs.royalapps.com/r2021/scripting/rjson/available-properties/royaljsonobject.html#securegatewayusage


You can find out the GUID of your various objects, by going to View > Properties and then selecting your desired object, as shown in this example:


Please let me know if this helped.


If you need further assistance you can also create a support ticket here:

https://www.royalapps.com/go/support-ticket-new


Best regards,

Christoph

Christoph, MATE!


You are amazing! 


This now works perfectly! I felt that I had missed something simple... 


Many thanks! 


            New-Object -TypeName System.Management.Automation.PSObject -Property @{

               "Type" = "RemoteDesktopConnection";

               "Name" = $computer.name;

               "Computername" = $computer.name;

               "CredentialName" = "cred";

               "Description" = $computer.description;

               "Path" = $computer.canonicalname.replace("/$($computer.name)", "");

               "SecureGatewayName" = "<ID found in properties>";

               "SecureGatewayUsageMode" = "Always";


Hi Jake,


that's great news, glad this worked for you.


Have a nice day!


Best regards,

Christoph

Login or Signup to post a comment