How To: Set default file associations in Windows 10 with Group Policy

How To: Set default file associations in Windows 10 with Group Policy

Setting file associations is no longer as simple as creating a “Open With” group policy preference. In order to deploy default file associations, we must now use dism to export an XML containing our preferences and deploy this with group policy.

In this example, we will force all files with a .xml extension to open with Microsoft Excel 2013.

Step one – setting the foundation:

First, we must set the file associations locally that we wish to be deployed to other computers.

We can do this one of two ways. We can either set it using an existing file with the extension we wish to set, or we can do it via the system settings and default apps. Personally, I find the new default apps interface to be a tad buggy, so we’re going to do it the ‘old-school’ way.

Right click a file with the type you wish to set and choose “Open With > Choose another app“.

First ensure you tick “Always use this app to open .xml files” and then select the program you wish to default to in the list of programs (or choose “Look for another app on this PC” if it is not in the list, and browse to the application.)

Step two – extracting the data to be deployed:

Now, we must export the newly set default file associations to an XML file that can be used by group policy to deploy to other computers. To do this, we use dism.

From the computer you previously set the default associations on, open up an elevated powershell window and run the following:

Dism /Online /Export-DefaultAppAssociations:C:\Your\File\Path\defaultassociations.xml

This will now create the XML we will be using to deploy these defaults.
If you wish, you can open this XML file with a text editor, and remove any file extensions you do not wish to set globally, before deployment.

Step three – place the XML file somewhere accessible:

In order for group policy to deploy your default file associations from this XML file, we must allow users access to the file. Place this file somewhere on your network where all users will have read access to it. I like to use the domain’s NETLOGON directory. (Yes, I’m aware that I should not use my external domain as my internal domain, due to the conflicts. I’m just too lazy to bother converting my internal domain to something within standards.)

Step four – creating our group policy:

Now we must create our self a group policy that will use this XML to deploy the associations. To do this,  from your domain controller, create yourself a policy with the correct scope and permissions, and then enable the following preference with the path to your XML:

Computer Configuration > Administrative Templates  > Windows Components > File Explorer > Set a default associations configuration file

Step five – testing our handy work:

Finally, let’s test our work was successful.
I like to force group policy to update, so from a test machine included in the group policy scope, open a command prompt and run:

gpupdate /force

Once this has completed, restart the test machine (as this is a computer policy, which requires a reboot to apply) and viola!

Before:

After:

0 comments