Java exception sites with Powershell

Many of you have came into this problem if you happen to support lots of users with access to certain sites that use Java Applets. Recently there was a change in Security approach in JRE for Java 8 environment.
You actually can’t set up Java to ‘Medium’ Security preset, therefore any site that you want your users to use with Java, needs to be added to so called ‘Exception sites’ list.
You can of course do this manually but I’ll show how to add Java exception sites with Powershell.

Powershell solution

If you’re still struggling with XP stations in your environment, you can also go batch/cmd way:

Batch solution

Either way, make sure you’re allowing the exceptions only if needed to minimize the risk of using security flaws in Java Applets.
Also, if target PC happens to have more than one user (for ex. general user and IT) but don’t have scripts on start from domain set up, you should think of iterating through all of the users in %systemdrive%\Documents and Settings (Windows XP) or %systemdrive%\Users (Windows 7 and later).

5 thoughts on “Java exception sites with Powershell”

  1. Hi Michal, I am using your powershell commands to add the exceptions but they are not working properly. I used the one for Win7 and they do appear in exception list but they still get blocked. Only when I add them manually do they work properly. For the sake of troubleshooting, yes I do close my browser completely after running the commands and reopen it.

    1. Hi Stephen,
      I remember encountering the same problem when there were actually two versions of Java: x86 and x64 placed in respective Program Files folders. They would act unexpectedly sharing same exception.sites – any chance that could be problem in your case?

  2. You maybe were elevating Powershell, so that it was seeing a different %userprofile%\ folder than the logged in user

Leave a Reply

Your email address will not be published. Required fields are marked *