Skip to main content

Worklet to remove all java versions

  • November 17, 2020
  • 0 replies
  • 139 views

Maikel
Forum|alt.badge.img
  • Channel Partner
  • 65 replies

Simple worklet to remove all java versions and write back in activity log. Worklet is maintained on our github page: https://github.com/Dutch-Technology-eXperts/Automox/blob/main/remove_java.ps1

Evaluation code:

Exit 1

Remediation code:

IF (gwmi Win32_Product -filter "name like 'Java%'")
{
[void](gwmi Win32_Product -filter "name like 'Java%'" | % { $_.Uninstall() })

if ($? -eq "True")
{ Write-Output "Java succesfully removed." }
else {Write-Output "Failed to remove Java!" }
}
ELSE {Write-Output "Java not installed."}

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings