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.
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.
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
Verify the XML file exists, as shown in Figure 2.
Open the Group Policy Management Console (GPMC) and create a new group policy, as shown in Figures 3 and 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.
Enable the Set a default associations configuration file policy setting and enter the path to the XML file, as shown in 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.