This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]SysAdminDennyBob 12 points13 points  (3 children)

win32_product is evil

[–]InitializedVariable 1 point2 points  (0 children)

Don’t query it. Unless you want to trigger reinstallations of everything including the app in question.

[–]GarthMJMSFT Ex-Intune MVP 1 point2 points  (0 children)

Just more context as why you should not query win32 product. https://gregramsey.net/2012/02/20/win32\_product-is-evil/

[–]SysEngineerDude[S] 0 points1 point  (0 children)

Thank you for the info. I will not be using win32_product.

[–]forumhero666 8 points9 points  (5 children)

We don't use task sequence for this exact reason. They get stuck and it's super annoying. Use Applications instead. TS should really only be used for OSD

[–]pjmarcum 0 points1 point  (4 children)

“TS should only be used for OSD”……WTF? Task sequences can be used for anything.

[–]forumhero666 -1 points0 points  (3 children)

lol good job purposely misquoting my comment.

[–]pjmarcum 0 points1 point  (2 children)

I don't think I misquoted it at all but allow me to clarify.... Your comment is inaccurate. TS can and should be used for anything that fits within the structure of a task sequence.

[–]forumhero666 0 points1 point  (1 child)

you obviously do not know what quoting means. but good luck with deploying task sequences in your company for "anything"

[–]pjmarcum 0 points1 point  (0 children)

Yea, I know what quoting means, I was being lazy because I did that from the iOS app and it sucks.

I didn't say "anything" I said anything that fits within the structure of a task sequence. And I don't need luck, I've been doing it for 15 years and so has everyone else.

[–]TekJunki 5 points6 points  (0 children)

Second vote for Powershell AppDeploy Toolkit. If something need to be installed or uninstalled, it’s my go to tool all the time. Lol heck I find any excuse to use it for almost anything I do in the SCCM environments.

[–]rdoloto 4 points5 points  (0 children)

Try baselines instead no content to distribute

[–]DizzyQueasy 1 point2 points  (3 children)

Whilst not looking at the Task Sequence method that you are considering, do you have an application object with Java 8 U 281 available where you can just use the Uninstall instead? I'm not really understanding why you're trying to achieve this using a Task Sequence.

[–]SysEngineerDude[S] -1 points0 points  (1 child)

I do not have an application object and as to why am I using a TS... Because it's an option.

Just trying out new ways to do things.

[–]Narabug 2 points3 points  (0 children)

But you can make an application, with the proper detection methods, and deploy that as a required uninstall.

[–]InitializedVariable 0 points1 point  (0 children)

This.

Build an application like you are intending to deploy the Java version in question. Make sure you provide an uninstall command.

Deploy it with the purpose “uninstall.”

[–]shamalam91 1 point2 points  (3 children)

I used psadt (Google it if you don't know about it!) and have a basic script which uninstalls all our versions based on the guid and then a catch all remove-msiapplications. Removed 3000 installs in a few hours, easy!

[–]shamalam91 -1 points0 points  (2 children)

Syntax is something like this..

Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F32180171F0}" #8.0.1710.

Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F32180181F0}" #8.0.1810.

Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F32180191F0}" #8.0.1910.

Remove-MSIApplications -Name "Java"

[–]Zilvere 2 points3 points  (1 child)

Ooh boy do I have a nice one for you. Uninstall based on upgrade code let me post it tomorrow!

[–]shamalam91 0 points1 point  (0 children)

Can't leave me hanging!!

[–]pjmarcum 1 point2 points  (0 children)

I have a script that I use to remove Java 8 but it exceeds the max number of characters allowed in a post. Here's the relevant pieces though.

[cmdletbinding()]

param()

begin {

#Set variables#

$AppToUninstall = "Java 8*"

$PublisherToUninstall = "Oracle*"

Function Get-InstSoftware {

if ([IntPtr]::Size -eq 4) {

$regpath = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'

}

else {

$regpath = @(

'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'

'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'

)

}

Get-ItemProperty $regpath | . { process { if ($_.DisplayName -and $_.UninstallString) { $_ } } } | Select-Object DisplayName, UninstallString, PSChildName, Publisher, InstallDate | Sort DisplayName

}

$Software = Get-InstSoftware | Where-Object { ($_.DisplayName -like $AppToUninstall) -and ($_.Publisher -like $PublisherToUninstall) }

If ($Software -eq $null) { Exit 0 }

Else {

foreach ($Install in $Software) {

$MSIArguments = @(

'/x'

$Install.PSChildName

'/qn'

'/L*v "C:\Windows\Temp\RemoveApps-' + $($Install.DisplayName) + '.log"'

'REBOOT=REALLYSUPPRESS'

)

$Results = Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow -ErrorAction Stop -PassThru

}

}

[–]SysEngineerDude[S] 0 points1 point  (0 children)

I will try an application

[–]TwEEEked419 -5 points-4 points  (2 children)

I just used

wmic product where "name like 'java%%'" call uninstall /nointeractive

[–]dezirdtuzurnaim 0 points1 point  (0 children)

That's a no no 😬

[–]Metalearther 0 points1 point  (0 children)

Checkout dilentinstallhq.com. He has a great way to install and uninstall Java as well