This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Uninstall GVM Endpoint with Powershell

I can install the Sophos Guest VM Agent with Powershell on virtual servers through some simple scripting but cannot figure out how to uninstall it with Powershell. I used the following script to install it and tried to manipulate it to uninstall the GVM.


$pathvargs = {C:\SVE-Guest-Installer.exe SVMIPAddress=<SVM IP> /S }
Invoke-Command -ScriptBlock $pathvargs

Anyway to manipulate this into an uninstall command?



This thread was automatically locked due to age.
Parents
  • Hello Jacob Buller,

    have you seen Guest VM Agent Deployment Methods? I think I've spotted an /uninstall switch in the text.

    Christian

  • Added this to the script but there are still two more issues with uninstalling Sophos from a GVM. Doing the uninstall gets rid of only the GVM Management Service. It does not remove the Scanning Services and on top of that the GVM Management Service and GVM Scanning Service still says they are installed on the VM under Uninstall Programs in Control Panel.

    I could go into there and manually remove these programs but there has to be a way to uninstall it using Powershell, psexec, or wmic. I have tried these but it only removes the services from the VM and not the programs.

    Doing a manual mass uninstall is just not feasible on VMs that number in the hundreds when moving away from this product in the future.

  • Hello Jacob Buller,

    I assume the components are correctly registered, thus you should find them (using the display name) under HKLM\SOFTWARE\[WOW6432Node\]Microsoft\Windows\CurrentVersion\Uninstall\ and there the value UninstallString. (it's usually either MsiExec.exe /X with a product code or a path to an executable).

    Christian

  • I removed the keys from the registry and then restarted the VM. When the VM booted back up all the services were gone and the program was uninstalled successfully. Then some more issues came up again. I tried to reinstall the GVM Services again and only the Management Services installed. I tried reinstalling again thinking it was a bug but it kept happening no matter how many time I reinstalled. Now I the Guest Installer cannot install the Scanning Services.

    Trying to do a simple uninstall of this software is way to complicated and just needs a simple uninstaller that removes it completely from the GVM and not just a certain component.

Reply
  • I removed the keys from the registry and then restarted the VM. When the VM booted back up all the services were gone and the program was uninstalled successfully. Then some more issues came up again. I tried to reinstall the GVM Services again and only the Management Services installed. I tried reinstalling again thinking it was a bug but it kept happening no matter how many time I reinstalled. Now I the Guest Installer cannot install the Scanning Services.

    Trying to do a simple uninstall of this software is way to complicated and just needs a simple uninstaller that removes it completely from the GVM and not just a certain component.

Children
  • Hello Jacob Buller,

    sorry, apparently I wasn't clear. The value in the UninstallString is the command to use to uninstall (Uninstall from Programs and Features does just that) with a script.

    removed the keys
    likely the corresponding keys under \HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\ are left behind which cause the install to fail.

    Christian

  • The keys under \HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\ do not exist or they were removed and the install is installing the Management Services just not the Scanning Services.

  • Hello Jacob Buller,

    I've been in a hurry yesterday so my reply was rather terse.
    Did I mention that I don't use or know the product, I'm just deducing from the behaviour of other products. I agree that if an installer/bootstrapper that eventually installs other components has an /uninstall option I'd expect that it uninstalls the component as well (the principle of least surprise) - or otherwise it should be noted, ideally with an explanation of the intended use. As an aside - the Startup Guide suggests Programs and Features for uninstallation, tells to select both these features subsequently listing three.

    Still deducing: The log(s) in the system %TEMP% directory should tell why the (re-)install failed. As said, I don't use the product so I can't tell what they look like.

    Christian

  • Thanks for the response Christian,

    I will take a look at the log files to see if anything is there but the issues I am having is when the SVM Guest Installer is installing its components it does not give me an error it just installs and I click finish. This installer comes packaged with another Scanning Service that does not tell you it installs along with the Management Services, you have to check the services if it installs correctly.

    I will take this up with support and see what they have to say. This is not a big deal right now as I was just testing on a Spare VM.

    Thank you for the suggestions,

    Jacob