How To.... - OneIdentity/SCALUS GitHub Wiki

Customize options in a Microsoft Remote Desktop connection file

When scalus is used to view a Safeguard session, the URL contains an authentication token. If the token is valid, and has not expired, then Microsoft Remote Desktop does not require a password.
If scalus is used to connect directly to a host, then you can provide a password if you wish to avoid being prompted each time it runs.
Any of the supported MS RDP options can also be customized by scalus. The following examples show how to do this with the supplied example applications: windows-rdp and windows-rdp-withtemplate.

Note: the password supplied in the RDP connection file must be encrypted. The encrypted password can be generated by running the command:

("mypassword" | ConvertTo-SecureString -AsPlainText -Force) | ConvertFrom-SecureString;

windows-rdp

This example uses the default template generated by the rdp parser. A perl script called examplePlugin.pl is then executed to customize any options required before running the application. To customize an option, add an entry to the settings table in examplePlugin.pl, e.g. to set the desktop width and height, use:

my %settings = qw{ 
desktopwidth   i:1024
desktopheight  i:1024   
};

To provide a password, add the following line to examplePlugin.pl, replacing encryptedpasswordvalue with your encrypted password:
my $spass="encryptedpasswordvalue";

windows-rdp-withtemplate

This example provides a complete template for the connection file (exampleRdpTemplate.rdp), which can be customized as required, e.g. to set the desktop width and height:

desktopwidth:i:1280
desktopheight:i:1024 

Set the encrypted password by adding the following line to exampleRdpTemplate.rdp, replacing encryptedpasswordvalue with your encrypted password:
password 51:b:encryptedpasswordvalue