Remove the Altiris Agent / Symantec Management Agent Subagents (PLUG-INS) through a logon script or similar

book

Article ID: 156049

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

Remove the Altiris Agent / Symantec Management Agent Subagents (PLUG-INS) through a logon script or similar

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 of agent plug-ins.

This would be useful if the agent is in a state, where this cannot be performed from the console, the agent service doesn't start due to plugin issue, etc.

After running the script, the agent will have the basic install agent and plug-ins only. At this time basic inventory should be sent up to the Notification Server, and the agent will receive the required plug-ins that it is targeted to contain as per configuration on the Notification Server. It will be performed as a result of regular configuration requests from the client.

@echo OFF
REM
REM Remove Symantec Management Agent subagents
REM  v 1.0, March 2012
REM

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

REM Check to see if agent is installed on the machine
if not exist "C:\Program Files\Altiris\Altiris Agent\AexNSAgent.exe" goto :end

REM Check if the agent is a Packager server, if it is then exit (Remove these lines to remove package server plugins)
if exist "C:\Program Files\Altiris\Altiris Agent\AeXNSCPackageServer.dll" goto :end

REM Perform Agent plugins uninstall using AeXAgentUtil /uninstallagents
start "Symantec Management Agent plug-ins Uninstall" /MIN /wait "C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe" /uninstallagents

REM Start agent service to assure that it doesn't stay stopped after uninstalling plugins. Register the client task agent.dll to make sure client gets registered to task server.

REM It will show command line message if service is started or stopped.

net start "Symantec Management Agent"
regsvr32 -s "C:\Program Files\Altiris\Altiris Agent\Agents\Client Task Agent\Client Task Agent.dll"

REM Cleanup; Timestamp Uninstall agents(for future check)
TIME /T > "C:\Program Files\Altiris\Altiris Agent\uninstallagents.log"

REM End of script
:end