Search code examples
remote-accessterminal-services

Can I send data to a RemoteApp using Remote Desktop Services?


When I launch a RemoteApp via Remote Desktop Web Access, is there a way to send data to the remote app?

Desired senario:

A user logs into a website with their credentials. They also provide demographic information such as first name, last name, address, etc.

The website connects to the RemoteApp via SSO and makes the demographic information available to the RemoteApp.

For example, if the RemoteApp is a Windows Forms app, can I get this information and display it in a message box?

Edit1: TomTom's response in this question mentions using named pipes to send data. Is that applicable to this problem?


Solution

  • It turns out you can pass command line parameters to the RemoteApp using the remoteapplicationcmdline property like such:

    remoteapplicationcmdline:s:/Parameter1: 5234 /Parameter2: true
    

    (The names "/Parameter1" and "/Parameter2" are just examples. Your remote app will have to define and handle these as appropriate.)

    This setting is part of the RdpFileContents property of the MsRdpClientShell object.

    Here is a resource for other RdpFileContents properties.

    Your code might end up looking something like this:

    MsRdpClientShell.PublicMode = true;
    MsRdpClientShell.RdpFileContents = 'redirectclipboard:i:1 redirectposdevices:i:0 remoteapplicationcmdline:s:/Parameter1: 5234 /Parameter2: true [Other properties here...]';
    MsRdpClientShell.Launch();
    

    For larger amounts of information, we might send preliminary data to a web service, retrieve an identifier back, pass this identifier to the RemoteApp via the command line, then have the RemoteApp query the web service to get all the information.