Skip to content

Instantly share code, notes, and snippets.

@AJ-Acevedo
Last active October 6, 2017 20:20
Show Gist options
  • Save AJ-Acevedo/22a33a3ded5677f7346e1c32e1b91657 to your computer and use it in GitHub Desktop.
Save AJ-Acevedo/22a33a3ded5677f7346e1c32e1b91657 to your computer and use it in GitHub Desktop.
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