Set default PDF reader with GPO depending on whether acrobat is installed.
Here’s how to set a default pdf reader (tested with Win 10) depending on whether acrobat is installed.
Create two xml files
Create two xml files and add them to an accessible network share with read only permissions for the user/computers you wish to apply this for.
XML File to set PDF reader as acrobat and chrome as default browser
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?xml version="1.0" encoding="UTF-8"?> <DefaultAssociations> <Association Identifier=".pdf" ProgID="Acrobat.Document.DC" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".pdfxml" ProgID="Acrobat.pdfxml" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".acrobatsecuritysettings" ProgID="Acrobat.acrobatsecuritysettings" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".fdf" ProgID="Acrobat.FDFDoc" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".xfdf" ProgID="Acrobat.XFDFDoc" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".xdp" ProgID="Acrobat.XDPDoc" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".pdx" ProgID="PDXFileType" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".api" ProgID="Acrobat.Plugin" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".secstore" ProgID="Acrobat.SecStore" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".sequ" ProgID="Acrobat.Sequence" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".rmf" ProgID="Acrobat.RMFFile" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".bpdx" ProgID="AcrobatBPDXFileType" ApplicationName="Adobe Acrobat DC" /> <Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> </DefaultAssociations> |
XML File to set chrome as the default browser and pdf reader
1 2 3 4 5 6 7 8 |
<?xml version="1.0" encoding="UTF-8"?> <DefaultAssociations> <Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" /> <Association Identifier=".pdf" ProgID="ChromeHTML" ApplicationName="Google Chrome" /> </DefaultAssociations> |
Copy Files To Local Computer
Create a GPO and under: ‘computer configuration -> Preferences -> Windows Settings -> Files‘
Create two files that are set to update. One file will have the source set to the acrobat xml file, and the other will have the source set to the chrome xml file. The XML file has the file to program association information set in it. Both should have the same target file which should be set to a local location on the computer which will be receiving this policy. On the next step, we decide which file actually gets copied.
Check item level targeting
Go to the common tab and check the item level targeting checkbox and click the targeting button
Set the first item level targeting filter for if acrobat is installed
For the file that has acrobat set as the default, add the condition to check if our program is installed, in this case, we check for the install folder. When you add this, click ok on the prompts and move to the next file.
Set the second item level targeting
For the file that has chrome as the default, add the same condition as you did on the previous step, but invert it . (You can click on the item options button to get not statements) Click ok on this.
Tell windows to use our xml file
Next, edit the preference item at:
Computer Configuration > Policies > Administrative Templates > Windows Components > File Explorer > Set a Default Associations Configuration File
Set the default configuration file to the path of the file that you created earlier.
Congratulations, you’re done. Be sure to test the GPO to make sure it works well.