Remove and (re) install the Altiris Agent / Symantec Management Agent through a logon script or similar

book

Article ID: 179900

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

 

Resolution

Below you will find a batch script that could be used in a logon script or other scripting procedures to perform a semi-automated removal and re-install of the agent.

This would be useful if the agent is in a state, where this cannot be performed from the console, the agent is 'stuck', etc.

When installed the agent will be installed with the basic install package. At this time basic inventory should be sent up to the server and the agent will receive the proper plug-ins that it is targeted to contain on the server after this point during regular configuration requests from the client.

REM
REM Remove and re-install Altiris/Symantec Management Agent
REM  v 1.0 RR, August 2010
REM

REM Check to see if we've run this installer before, if we have exit
if exist "C:\Program Files\Altiris\Altiris Agent\reinstall.txt" goto :end

REM Check if the pcAAgent.dll is installed on the computer
REM If this dll is not present we assume this is a bad Agent Install
if exist "C:\Program Files\Symantec\pcAnywhere\pcAAgent.dll" goto :end

REM Perform Agent uninstall using AeXAgentUtil /clean
start "Altiris Agent Uninstall" /MIN /wait "C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe" /clean

REM Map the network share to the NS\NSCap directory to pull/install agent package from.
REM Change/update drive letter as necessary, as well as servername etc;
net use u: "\\NS_ServerName\NSCap\Bin\Win32\X86\NS Client Package"
start "Altiris Agent Install" /MIN /wait u:\AeXNSC.exe -s -a ns=NS_ServerName.domain.local nsweb=http://NS_ServerName.domain.local/Altiris NOSTARTMENU /s

REM Cleanup; Timestamp reinstall (for future check) and un map drive share
TIME /T > "C:\Program Files\Altiris\Altiris Agent\reinstall.txt"
net use :u /DELETE

REM End of script
:end