In the following example we'll put together a very simple browser-based application launcher that uses the RAS Web Client.
Before we begin, let's make sure that our RAS Secure Gateway configuration meets the requirements:
In the RAS Console, navigate to Farm > <Site> > Gateways.
Right-click a Gateway and click Properties.
In the Properties tab, make sure that the Enable RAS Secure Gateway in site option is selected.
In the User Portal tab, make sure that the Enable User Portal option is selected.
Make sure that the Web Client opens in your default web browser.
We are now ready to create our custom resource launcher. In this example, we are making the following assumptions:
Our Secure Gateway is running on the server with the following IP address: 192.168.10.10.
Our web server is running on the server 192.168.20.20.
The published resource that we'll be launching is Google Chrome and it's ID the in the RAS Console is "#4".
You can look up the ID in the RAS Console (Publishing > select a resource > Information tab > look at the first field on the tab page, which displays the resource ID followed by resource name). Note that the pound sign (#
) must be included together with the actual ID. You can also obtain a resource ID via RAS PowerShell by executing Get-RASPubItem "resource-name"
. The returned PubItem
object has the Id property that specifies the resource ID. To get the list of all available published resources, execute the Get-RASPubItem
cmdlet with no parameters.
First we need to create a JSON payload containing user credentials and the application info. To do so, open a text editor and type (or paste) the following:
In the payload above, substitute 'user-name' and 'user-password' with your own. Change the "a:" parameter value to the ID of the published application that you wish to launch. Save the payload as a text file with the ".js" extension in the folder on your web server. In our example, we'll save the file as Google-Chrome.js in the wwwroot folder of our web server.
We now need to create a web page from where users will be launching our published application:
Create a simple HTML page and save it to a folder on a local web server from where it can be opened in a web browser.
Add the following link to the web page and name it "Google Chrome" (or use the name of your own application):
https://192.168.10.10/userportal/?https://192.168.20.20/Google-Chrome.js#/launch
In the URL above, substitute the Gateway address (192.168.10.10) and the web server address (192.168.20.20) with your own, and use the ".js" file name that you created in previous steps.
Save the web page.
To test our custom launcher:
Open the web page in a browser.
Click the Google Chrome link (or the name you used).
The remote application will open in the browser using Parallels Web Client.