Skip to content

Instantly share code, notes, and snippets.

@heyvoon
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heyvoon/07846f12ba46481b4357 to your computer and use it in GitHub Desktop.
Save heyvoon/07846f12ba46481b4357 to your computer and use it in GitHub Desktop.
Discover_JavaAutoupdateIsOn.ps1
<#
This script will check if automatic updates is disabled and return a Compliant/Non-Compliant string.
Name: Discover_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”)
{
If(Test-Path ‘HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’)
{
$UpdateCheck = Get-ItemProperty ‘HKLM:\SOFTWARE\Wow6432Node\Javasoft\Java Update\Policy’ -Name EnableAutoUpdateCheck, EnableJavaUpdate, NotifyDownload, NotifyInstall
if (($UpdateCheck.EnableAutoUpdateCheck –eq 0) –and ($UpdateCheck.EnableJavaUpdate -eq 0) –and ($UpdateCheck.NotifyDownload -eq 0) -and ($UpdateCheck.NotifyInstall -eq 0))
{Write-Host ‘Compliant’}
else
{Write-Host ‘Non-Compliant’}
}
else
{Write-Host ‘Non-Compliant’}
}
else
{
If(Test-Path ‘HKLM:\SOFTWARE\JavaSoft\Java Update\Policy’)
{
$UpdateCheck = Get-ItemProperty ‘HKLM:\SOFTWARE\JavaSoft\Java Update\Policy’ -Name EnableAutoUpdateCheck, EnableJavaUpdate, NotifyDownload, NotifyInstall
if (($UpdateCheck.EnableAutoUpdateCheck –eq 0) –and ($UpdateCheck.EnableJavaUpdate -eq 0) –and ($UpdateCheck.NotifyDownload -eq 0) -and ($UpdateCheck.NotifyInstall -eq 0))
{Write-Host ‘Compliant’}
else
{Write-Host ‘Non-Compliant’}
}
else
{Write-Host ‘Non-Compliant’}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment