Created
May 19, 2015 11:01
This script will disable automatic updates if it is enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
This script will disable automatic updates if it is enabled. | |
Name: Remediate_JavaAutoupdateIsOn.ps1 | |
Created: 16.05.2015 | |
Version: 1.0 | |
Author: Teksoporte.es | |
Homepage: http://blog.teksoporte.es | |
#> | |
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture | |
If($OSArchitecture.OSArchitecture -ne "32-bit") | |
{ | |
Set-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy' -Name EnableAutoUpdateCheck -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy' -Name EnableJavaUpdate -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy' -Name NotifyDownload -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy' -Name NotifyInstall -Type DWORD -Value 0 -Force | |
Write-Host ‘Compliant’ | |
} | |
else | |
{ | |
Set-ItemProperty 'HKLM:\SOFTWARE\JavaSoft\Java Update\Policy' -Name EnableAutoUpdateCheck -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\JavaSoft\Java Update\Policy' -Name EnableJavaUpdate -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\JavaSoft\Java Update\Policy' -Name NotifyDownload -Type DWORD -Value 0 -Force | |
Set-ItemProperty 'HKLM:\SOFTWARE\JavaSoft\Java Update\Policy' -Name NotifyInstall -Type DWORD -Value 0 -Force | |
Write-Host ‘Compliant’ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or
both variants shorter in 5 lines of duplicated code