[PS] Add Java exceptions to a remote computer

Hi! Another simple script i use quite often is the “Java-exception-adder”. The script adds URL exceptions to a remote computers Java exception list. (exception.sites) You obviously need to be local admin at the remote computer.

(Don’t get confused, this is with Swedish language)
  1. Run the script
  2. Enter the computername that you want to add the Java exception to (exception.sites)
  3. Enter the URL (with http:// or https:// before) that you want to add
  4. Press enter


$pc = Read-Host "Enter a computername "
$exception = Read-Host "Input URL that you want to add to the JAVA exception list "

Invoke-Command -ComputerName $pc -ScriptBlock {
Set-Content -Value "deployment.system.config=file\:\\C\:\\Windows\\Sun\\Java\\Deployment\\deployment.properties" -Path C:\Windows\Sun\Java\Deployment\deployment.config
Set-Content -Value "deployment.system.config.mandatory=True" -Path C:\Windows\Sun\Java\Deployment\deployment.config
Set-Content -Value "deployment.user.security.exception.sites=C\:\\Windows\\Sun\\Java\\Deployment\\exception.sites" -Path C:\Windows\Sun\Java\Deployment\deployment.properties
Add-Content -Value "$Using:exception" -Path C:\Windows\Sun\Java\Deployment\exception.sites


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.