

- #Wmic uninstall return value 1603 update
- #Wmic uninstall return value 1603 full
- #Wmic uninstall return value 1603 software
The point was to keep things simple here though, not get to perfection - come to think of it, that's the point of most scripts we write.

For me, using write-host is almost always a last resort - there's always a better option.
#Wmic uninstall return value 1603 full
That "write-host" line especially would benefit from me making that an array of results, which would allow you at the end you to list out the full results, but then also just the failed results for instance. Not the most elegant piece of code, and certainly not the fastest, but it’ll get the job done. Whatever method you used to get your list, MANUALLY CHECK IT AND EDIT IT FIRST, before you proceed: If you take this approach, maybe you just want the non-servers: Or maybe we’ll pull the target station list right out of AD.
#Wmic uninstall return value 1603 software
Maybe you got that computer list from working through your Nessus report, or maybe output from your software inventory system: Next, get your list of servers into an object. We start by getting domain admin credentials (remember that you need admin rights to delete an app) So, putting it all together, let’s delete a target app remotely in a typical company.

If $killit.ReturnValue is non-zero, the uninstall was not successful – a value of 1603 for instance means you don’t have rights to uninstall the apps, retry as local admin (or domain admin) Then, to uninstall our target application, for each instance, we want to execute:

(note the escaping to make the quote characters around the values) The $classkey variable shown is the string needed to “fully qualify” the application to delete – let’s just look at the first app in the list: That’s all the basic information we need to delete an app, let’s put it together. OK – now let’s just pick the apps we want to remove: Next, let’s get the info we need to delete an app – the App name, version and “IdentifyingNumber” (the application’s GUID): If you don’t have a software inventory solution, Powershell can get the job done with just a bit of scripting (note that this is does not show the entire list of members in $apps - it's a pretty long list) Let’s start by listing the apps on a workstation. Say, with nothing but Powershell? In years past, I would have used WMIC and cmd files, but Powershell is much faster and much more flexible. How can you do this for free, without buying a full software inventory and management system.
#Wmic uninstall return value 1603 update
But what if the final finding isn’t “Lets update Java” but rather, “Why do we need JRE installed at all? Let’s delete it across the domain” Double check if you have got the product description accurately.In my last story, we went over winnowing through a Nessus scan to determine which apps you might want to patch. If you get the error No Instance(s) Available, it means that there’s no such product installed on your system. Let’s say we want to uninstall ‘Java 7 Update 79 (64-bit)’ C:\WINDOWS\system32>wmic product where "description='Java SE Development Kit 7 Update 79 (64-bit)'" uninstallĮxecuting (\\mypc\ROOT\CIMV2:Win32_Product.IdentifyingNumber="",Name="Java 7 Update 79 (64-bit)",Version="7.0.790")->Uninstall() I have above versions of JDK on my system. Java SE Development Kit 8 Update 45 (64-bit) Java SE Development Kit 7 Update 79 (64-bit) C:\>wmic product get description | findstr /C:"Java" Uninstall Java SDK/JDK from command promptįirst you need to find the version of the Java installed on the system. Below are few examples for uninstalling different programs.
