Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deploy new Samanage Agent and uninstall old agent
:: SamangeDeploy
:: Description: Verify if the old version of Samanage is installed, uninstall and update to latest version
::
:: URL: AJAlabs.com
:: Author: AJ Acevedo
:: Copyright (c) 2017 AJ Acevedo
:: License: MIT - https://opensource.org/licenses/MIT
::
:: Version: v1.0
::
@echo off
:: Check if the latest SAManage Agent is already deployed on the target host
if exist "C:\Program Files\Samanage Agent\agent\src\mini_kernel\service.*" goto END
if exist "C:\Program Files (x86)\Samanage Agent\agent\src\mini_kernel\service.*" goto END
:: Deploying latest SAManage agent in silent mode
"P:\IT\Samanage\Samanage_Agent_1.1.303_1.1.36_203_208_installer.exe" --mode unattended
:END
:: Check if the old SAManage Agent is already deployed on the target host
if exist "C:\Program Files\SAManage\*.exe" goto REMOVE
if exist "C:\Program Files (x86)\SAManage\*.exe" goto REMOVE
:REMOVE
:: Uninstall the old SAManage Agent in silent mode
"C:\Program Files (x86)\SAManage\uninst.exe" /S
:: Script Complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.