Last active
August 29, 2015 14:21
-
-
Save heyvoon/07846f12ba46481b4357 to your computer and use it in GitHub Desktop.
Discover_JavaAutoupdateIsOn.ps1
This file contains 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 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