AnsweredAssumed Answered

How to prevent the agent from being uninstalled

Question asked by Oz Merchant Administrator on Jul 5, 2016

The Samanage agent installs as a service that can only be removed if you have administrative rights on the local machine. For organizations where every user has administrative privileges and you're using the group policy deployment method. You can prevent users from uninstalling the agent with a simple .bat script. You'll notice that it is a slight modification to the existing group policy script.


This script basically renames the uninstall executable so that going to add/remove does not actually stop the agent from reporting. However it does not remove the uninstaller so with a slight modification to the script or to the local machine you can still uninstall when necessary:



@echo offREM === Uninstaller still on?
if exist "C:\Program Files\SAManage\uninst.exe" ( RENAME "C:\Program Files\SAManage\uninst.exe" "uninst.0exe" )
if exist "C:\Program Files (x86)\SAManage\uninst.EXE" ( RENAME "C:\Program Files (x86)\SAManage\uninst.EXE" "uninst.0exe" )
REM ===Delete the uninstaller
REM === End of script

As always test with a few machines before running across your entire organization.