-1

I have a user who needs iCloud uninstalled. The problem is I have heard her through the walls coughing like a sick llama for two weeks now (“HAROUUUUUU”) and I don’t want to get what she’s giving.

How do I uninstall the program remotely?

Windows 7 on both ends, AD, I have enough domain permissions to view installed programs on her computer with

wmic /output:c:\userName.txt /user:MYUSERNAMEHERE /node:"THEIRCOMPUTERNAME" product get name

(don't neglect the quotes around their computer name) and I can also browse her C$ drive.

EDIT: I posted both the question & answer in order to spread knowledge. Though this example was when I learned how to uninstall remotely even though it was a one-off deal, perhaps a better case for using the solution below is when you need to do a quiet uninstall, which I happened to do for this user to avoid interrupting the user's workflow, or for a mass uninstall over the network.

seizethecarp
  • 757
  • 1
  • 7
  • 17
  • 3
    Use remote desktop and login to the machine in order to uninstall that software if you don't have any management tool for this in place. – Seth Nov 06 '17 at 15:11

1 Answers1

0

This is a compilation answer of two very knowledgeable sources:

Step 1, from Where does Windows store MSI files for uninstallation? find the MSI that the program was (usually) installed with (skip to “2)” for the easier way to do it):

When a user installs some app, Windows does the following:

1) Creates a registry key for this app.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall[ProductId GUID]

If you have access to the original msi file of installer of your app, you can find [ProductID GUID] by opening the msi file in orca.exe and clicking on the "Property" on the left in orca, and looking for "ProductCode" line on the right. If you do not have access to original *.msi file, you can just search registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for the name of the app.

If you want to delete your app (which refuses to uninstall for example) from the list of installed apps in Control Panel, you can delete the entry from this Uninstall key. It will surely disappear from the list in control panel, but Windows will still remember it. For example, if you try to install a next version of the same app, Installer may still insist on uninstalling the previous version. See item 2 for that.

2) Windows copies the original *.msi file into the folder C:\Windows\Installer and renames it to a random name (keeps .msi extension though). Windows also creates a key in registry in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData[InternalUserId]\Products[some random guid-like sequence of chars identifying to windows your installation]\InstallProperties. ValueName "LocalPackage" in this reg key will point to the renamed msi file. To find the file in C:\windows\Installer you can navigate to this folder in Windows explorer, switch it into Details view, make column "Subject" visible and you will see for all nnnnnnnn.msi fies their corresponding name of product. – note, after adding “Subject” change the sort by order to refresh the listing

3) This was necessary for @Joe B from the link above: I had to copy the 5188bfc6.msi file ( hex#.msi ) and rename it to the original file name MyApp.msi, before uninstaller would accept the file. After this uninstall worked fine.

Step 2, install PsExec (from MS) - these instructions taken from https://techtalk.gfi.com/how-to-uninstall-software-from-remote-pcs-using-the-command-line/ :

Download PSEXEC from Microsoft at http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx. Install it onto your computer by copying the file to a directory in your PATH. System32 will do nicely, or you can create a new directory to store your favorite command line tools and add it to your path.

Step 3, uninstall the program:

1.Open an administrative command prompt on your machine where you have copied PSEXEC.

2.Run the following command.

psexec \\remotecomputername  msiexec /x /q pathtotheMSIfile

The UNC path to the remote computer can use either the NetBIOS name or the FQDN. The path to the MSI file must be relative to the machine you are uninstalling the software from. Again, a UNC path works well here. The /x means to uninstall, and /q means to do so without user input (quietly.)

Pro tip: If you use psexec \* it will run against every computer in the domain!

You can use that WMIC command again to make sure it’s gone afterward

wmic /output:c:\userName.txt /user:MYUSERNAMEHERE /node:"THEIRCOMPUTERNAME" product get name
seizethecarp
  • 757
  • 1
  • 7
  • 17
  • @EricF do note, the answer is provided by the person who asked the question. Its obviously meant to spread knowledge. But yes, RDP would be better suited for the case OP describes. But from an administrative point of view, this answer would work better. For example when you manage a domain with 1000+ workspaces and you need a way to remotely uninstall software, this is the way to go. – LPChip Nov 06 '17 at 15:40
  • @LPChip - For some odd reason I didn't notice it was Eric asking how this was easier then RDP. – Ramhound Nov 06 '17 at 16:22
  • @Ramhound yeah, I already noticed. :) – LPChip Nov 06 '17 at 16:32
  • @EricF - I am not implying anything. However, this answer, does answer the author's question (considering the author submitted it themselves). – Ramhound Nov 06 '17 at 17:15
  • @EricF - First I didn't noticed the author submitted the answer at first. In addition to that I thought the author submitted the comment itself. So my response was more of, "this answers the question", and the answer is how you would remotely install a program. I was honestly, confused by the comment itself, because the question and this answer both seem self-explanatory. – Ramhound Nov 06 '17 at 17:23
  • @Ramhound No worries then. I shall delete all of this. There are certain users on here that I get a feel for after time and was just making sure I wasn't in bad terms with you is all. No problem though :) – Eric F Nov 06 '17 at 17:32
  • So since I'm posting this as a knowledge-base kind of thing, should I edit the question to make the answer more appropriate for it? Because @Seth's answer would normally be a good solution too. However, in the case of remotely uninstalling for multiple users without interrupting workflow, this is helpful – seizethecarp Nov 06 '17 at 17:45