Wilco van Bragt - LinkeIn Wilco van Bragt - Twitter rssa 

Client to Server Redirection Explained

Introduction

In Citrix Metaframe XP Feature Release 2 Citrix has introduced content redirection. Content redirection can be divided in two parts. 

  • Server to Client content redirection; this part made is possible to start URL’s locally on the client PC. Embedded URLs are intercepted on the server running Presentation Server and sent to the client. The user’s locally installed browser is used to display the website.
  • Client to Server content redirection; this part makes it possible when a user double-clicks a file the corresponding application is started on the Citrix server.

This article will describe in detail the second part of the content redirection named Client to Server content redirection. First I will describe the requirements, followed by the standard configuration of Client to Server Redirection. Also this article will contain a paragraph about troubleshooting and last but not least I will describe a solution that will allow you to tweak Client to Server redirection.




Requirements

As mentioned since Metaframe XP Feature Release 2 (FR2) content redirection is available within the Presentation server suite and is not changed much in the time. So everything explained in this document applies to all versions from the Metaframe XP FR2 till Citrix Presentation Server 4.

To use Client To Server redirection you are limited to some components and requirements, which I will describe this in this paragraph.

Citrix Program Neighborhood

Before you can use client to server redirection you need to make a design decision.
Client to Server redirection is namely only available when using the Citrix Program Neighborhood Agent (PNAgent). Using the PNAgent can change the way users are used to start their applications, if you are already using Citrix. Also using PNAgent has one big requirement.

Web Interface

This requirement is Citrix Web Interface. Citrix PNAgent connects to the Web Interface to query which applications are available for the user and which file associations are available. Web Interface runs on a Microsoft Internet Information Server, so you need at least one server. For fault tolerance and load balancing and avoiding a Single Point of Failure (SPOF) you can think of using two Web Interface servers.

Advanced of Enterprise version

Client to Server redirection is not available in all options. Only the Advanced and Enterprise version have the Client to Server redirection feature available.

Client Drive Mapping

Client Drive Mapping is the last requirement for Client to Server Redirection. Without mapped client drives the feature does not function, so client driver mapping need to be enabled.

Configuration

Configuring Client to Server redirection is actually pretty easy normally. Of course you need to configure your Web Interface Server en install and configure the Citrix PNAgent as you are used normally. When publishing an application you can pick out in the last screen during the Publish Application the file extensions you want to associate to that application.

Image
Figure 1: Specify a file association to the published application

But sometimes the file extension is not available as a choice in the Citrix Management Console. What can you do than?

Image
Figure 2: No file extensions are available for the published application

Helping the Citrix Management Console

Of course you would like to associate that extension to your Published Application.
The first step you could do is refreshing (or actually update) the Citrix Management Console via clicking the right mouse at the Farm properties and choose Update File Types from registry. Choose (one of the) server(s) on which you installed the application in the wizard. After a few minutes the file extension should be available in the Citrix Management Console.

Image
Figure 3: Updating the file type within the Citrix Management Console

During this process the Citrix Management Console is reading the file associations in the registry of that server. If you would like to use file extensions which is also not registered on the server you can arrange this file association by yourself.

There are several ways to do this. The easiest one is to add the file association manually on the server(s). This can be done within Folder Options via the menu option Tool out of Explorer.  Add a new File Type, I advice to add the application via the Advanced button. In this way you have more flexible configuration options. In the next print screen I added the file extension .euh to start with the Notepad application.

Image
Figure 4: Adding manually a file extension on the server

Other ways to achieve the same result can be done via the assoc command or as described in the Microsoft Knowledgebase article. After Updating File Types from registry option in the Citrix Management Console you can add the file extension to the Published Application.

But sometimes above mentioned work around to add your file association can not be used. For example is when you need to start additional scripts or command before the application starts and you worked this out to publish a batch file with these commands followed by starting the application or if you are using a third party product like Powerfuse which publish the application with their executable, it is not possible or easy to arrange the file association on the servers. If you using the same server for publishing a desktop and don’t want the file association for the users, which are accessing the application within the desktop session.

Creating Client to Server Redirection on your own

Because you can not set the file association for in this way via the Citrix Management Console, we should find another solution. The most obvious way to accomplish this is trying to set these settings on the client PC. Normally workstations with PNAgent configured are managed systems so there are some possibilities.

Actually you can add these file associations add the same way Citrix does this for the applications. Citrix stores the file associations in the HKEY_CURRENT_USER key under Software\Classes in a straight forwarded method. It is a good way to this within the [HKCU] key, so you have the possibility to add file associations on a group or user base without conflicting those settings (different users need the same file association for a different application).

First you need to create the configuration for redirecting the file to a published application. Therefore a new key needs to be created in the [HKCU]\Software\Classes. I will follow the same convention as Citrix does, so I will use the following convention <FILEEXT>FILE.CTX, for example MPPFILE.ctx.

Within this key the following keys in figure need to be created as displayed in figure five.

Image
Figure 5: Overview of the registry file assocation

Within the DefaultIcon key the default value will be filled with data where to find the icon. Citrix uses normally the PNAgent cache, so I will advice to use that cache also.
Standard this cache is stored in C:\Document and Settings\%username%\Application Data\Citrix\PnAgent\Appcache\<APPLICATION NAME>,ico.

The application name is the value which is specified as Application Name in the Published Applications properties. In figure six this property is red outlined.

Image
Figure 6: This is the property that needs to be filled in the several values.

Within the [HKCU\Software\Classes\<FILEXT>FILE.CTX\shell\open command also the default value need to be configured. This data points to the application that needs to be started. Here we are using the PNAgent executable with parameters /launch followed by the application name and /param:\\Client\%1. Figure seven shows the example of Microsoft Project published using RES Powerfuse.

Image
Figure 7: Examples of the two keys. Above the DefaultIconCache, below the Command data.

To activate the created file association you need to specify which file extension(s) should use this file association.  Therefore also in [HKCU]\Software\Classes a new key should be created of the file extensions. In this example this would be .MPP. In the default value we fill the keyname <FILEEXT>FILE.ctx, so MPPFILE.ctx. If you want to associate another file extension just adds this one also within this key with the data in the value pointing to <FILEEXT>FILE.ctx, for example for the .MPT.

Our example configuration would be as displayed in figure eight.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\MPPFILE.ctx]

[HKEY_CURRENT_USER\Software\Classes\MPPFILE.ctx\DefaultIcon]

@="C:\\Documents and Settings\\%username%\\Application Data\\Citrix\\PNAgent\\AppCache\\Microsoft Proje - My_Applications {47}.ico,0"

[HKEY_CURRENT_USER\Software\Classes\MPPFILE.ctx\shell]

[HKEY_CURRENT_USER\Software\Classes\MPPFILE.ctx\shell\open]

[HKEY_CURRENT_USER\Software\Classes\MPPFILE.ctx\shell\open\command]
@="\"C:\\Program Files\\Citrix\\ICA Client\\pnagent.exe\" /launch <Microsoft Proje - My_Applications {47}> /param:\"\\\\Client\\%1\"" [HKEY_CURRENT_USER\Software\Classes\.mpp]
@="MPPFILE.ctx"

[HKEY_CURRENT_USER\Software\Classes\.mpt]
@="MPPFILE.ctx"

Figure 8: The complete configuration for Microsoft Project (via RES Powerfuse) including two file extensions.

Of course this configuration can be added with more file extensions for more published applications.

The last step is to distribute the configuration to the client with the PNAgent on it. This can be done via a registry (exported) file or your own (VB)script and import those via a distribution software product, login script or GPO’s.

Conclusion

In this article I described how Client to Server redirection works, which requirements need to be filled in and in which way you configure this options and how to update the Citrix Management Console with file types. The second part of this article described how you can add file associations manually using two methods. The first method is adding file associations on the server, the second method adds the file associations on the client if for described reasons method one can not suit your needs.

Article previous published at MSTerminalServices.org.