Citrix XenApp 7.x on Windows Server 2012 or 2012 R2 – Setting File Type or Application Associations

One of the nice things about being a consultant is that on every project you run into something you have never seen before or asked to do something no one else has asked you to do before. As a consultant, I am always learning new things or a new way of doing something I have been doing for years. Recently I was asked to help finish up a XenApp 7.6 deployment running on Windows Server 2012 and Server 2012 R2. One of the problems I was tasked to resolve was that some application associations were not working. One specific example was that embedded links in emails, when Ctrl+Clicked, would not open in the default browser. Here is how I solved that issue.

In versions of Windows prior to Windows 8/Server 2012, I always used a Group Policy Preference (GPP) to set File Type Associations. However, for the applications published on Server 2012+, the GPP never set any associations. As in most cases when I am stumped, I turned to super smart young squirt Jarian Gibson. Jarian told me he had just solved this for one of his customers in the previous week or so.

This is the solution Jarian pointed me to – Windows 8: Associate a file Type or protocol with a specific app using GPO

I found these parts of the article interesting:

In  Pre-Win 8, apps could set the default handler for a file type/protocol by manipulating the registry, this means you could easily have a script or a group policy manipulating the registry.

However In Win 8, the registry changes are verified by a hash (unique per user and app)  that detects tampering by apps. In the absence of a valid hash, we ignore the default in the registry.

Solution:
Microsoft  have  introduced a new GP mechanism for declaring these defaults in Win 8 to accommodate this type of scenario.

That TechNet blog pointed to another TechNet article on using Dism.

The Solution

To set the associations, use the following steps:

On the XenApp server running Windows Server 2012+, run the following command (as shown in Figure 1):

Dism /Online /Export-DefaultAppAssociations:\\Server\Share\AppAssoc.xml
Figure 1

Figure 1

Verify the XML file exists, as shown in Figure 2.

Figure 2

Figure 2

Open the Group Policy Management Console (GPMC) and create a new group policy, as shown in Figures 3 and 4 .

Figure 3

Figure 3

 

Figure 4

Figure 4

Edit the new group policy, and navigate to Computer Configuration\Policies\Administrative Templates\Windows Components\File Explorer\Set a default associations configuration file as shown in Figure 5.

Figure 5

Figure 5

Enable the Set a default associations configuration file policy setting and enter the path to the XML file, as shown in Figure 6.

Figure 6

Figure 6

Click OK, exit the group policy editor, and link the new policy to the appropriate Organizational Unit for your XenApp servers that use Windows Server 2012+. After the group policy refresh interval or restarting the server(s), the new group policy setting will be applied and application associations will now work.

The main problem with this new method is that the XML file is static. If any new applications (with file type associations) are installed, the XML file will need to be recreated.

Hope this helps someone else that finds themselves in the same situation of needing to set File Type or Application associations for WIndows Server 2012 or Server 2012 R2.

Thanks

Webster

 

 

 

 

 

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

8 Responses to “Citrix XenApp 7.x on Windows Server 2012 or 2012 R2 – Setting File Type or Application Associations”

  1. Dries Vandooren Says:

    Hi Webster
    We have a similar problem with a windows server 2016, if we try to open a URl, it keeps asking what program we’d like to open the link with. Even if we select “always use this app” it doesn’t stay as default. I tried this way to fix it, but it doesn’t appear to work. Do you know of a fix for this problem with windows server 2016?
    We’ve tried numerous things the last week, but nothing seems to fix this issue.

    Reply

  2. Kevin Says:

    I Tried this group policy with xml file and found that after you implement this and then someday down the road you uninstall a program the server crashes on reboot because that application is in the .xml and not installed anymore.

    Reply

    • Carl Webster Says:

      I checked with two Group Policy MVPs who have never heard of this issue.

      Webster

      Reply

    • Carl Webster Says:

      I am unable to duplicate the issue.

      I created a XenApp 7.13 server based on Server 2016.
      I installed Google Chrome, IrfanView, 7Zip and Adobe Reader DC.
      I set all four apps to be the default handler for all their file types.
      I opened files of various types to make sure the right programs were used.
      I then did the “dism” stuff to export the app associations to an XML file.
      Created a GPO linked to the OU where my XenApp server is for App Associations.
      I restarted the server and made sure the GPO applied.
      I opened files of various types to make sure the right programs were used.
      I uninstalled IrfanView which gave me a popup saying all the file types were reset to Windows defaults Restarted the server and logged in. No server crash.
      I opened a PNG and a JPG file and they both open in Paint.
      I uninstall Adobe Reader DC.
      Restarted the server and logged in. No server crash.
      I opened a PDF and it opened in Chrome.
      I uninstalled 7Zip.
      Restarted the server and logged in. No server crash.
      I opened a ZIP file and File Explorer asked to Extract it.
      I uninstalled Chrome.
      Restarted the server and logged in. No server crash.
      I opened an HTML file and Edge started.
      I opened the PDF file and Edge started.

      Unable to repro.

      Thanks

      Webster

      Reply

  3. Brian Mooney Says:

    Carl,
    Can you check out the following Citrix discussion and perhaps lend your ninja skills to the table?

    http://discussions.citrix.com/topic/385357-users-are-prompted-to-specify-internet-browser-when-you-click-on-a-link-in-outlook-2016/?p=1962373

    Reply

  4. James Rankin Says:

    Hi Webster

    The problem I found with Windows 8.x/Server 2012 R2 associations is that they can only be set on a per-device basis. The solution you’ve described works excellently, as long as users don’t need individual FTAs on the XenApp server system.

    Myself and Duncan Murdoch tried to find a way around this – a bit hit-and-miss but we managed to get it working on a XenApp 7.6 instance with a bit of PowerShell jiggery-pokery. See http://appsensebigot.blogspot.co.uk/2015/10/deploying-per-user-file-type.html

    Cheers,

    JR

    Reply

Leave a Reply