Created
May 13, 2014 03:33
-
-
Save MyITGuy/21e67aa9daea76b31bbb to your computer and use it in GitHub Desktop.
Symantec Agent Repair 1: Stops the agent, deletes task management data, deletes queue data, starts the agent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psexec \\COMPUTER -d -f -c "agent_repair_1.cmd" | |
@ECHO OFF | |
REM Get the InstallDir from the registry | |
FOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Altiris Agent" /V "InstallDir" ^| FINDSTR /i /c:"InstallDir"') DO SET InstallDir=%%B | |
IF NOT DEFINED InstallDir ( | |
FOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Altiris\Altiris Agent" /V "InstallDir" ^| FINDSTR /i /c:"InstallDir"') DO SET InstallDir=%%B | |
) | |
IF NOT DEFINED InstallDir GOTO:EOF | |
IF DEFINED InstallDir ECHO InstallDir: %InstallDir% | |
ECHO Disabling AeXNSClient service | |
sc config AeXNSClient start= disabled | |
for /F "tokens=3 delims=: " %%H in ('sc query "AeXNSClient" ^| findstr /i /c:"STATE"') do ( | |
if /I "%%H" EQU "RUNNING" ( | |
ECHO Stop AeXNSClient service | |
"%InstallDir%\AeXAgentUtil.exe" /Stop | |
) | |
) | |
ECHO Kill AeXNSAgent.exe process | |
taskkill /im AeXNSAgent.exe /f | |
ECHO Remove TaskManagement folder | |
IF EXIST "%InstallDir%\TaskManagement" RD /Q /S "%InstallDir%\TaskManagement" | |
ECHO Remove TaskManagement folder | |
IF EXIST "%InstallDir%\Queue" RD /Q /S "%InstallDir%\Queue" | |
ECHO Enable AeXNSClient service | |
sc config AeXNSClient start= auto | |
for /F "tokens=3 delims=: " %%H in ('sc query "AeXNSClient" ^| findstr /i /c:"STATE"') do ( | |
if /I "%%H" NEQ "RUNNING" ( | |
ECHO Start AeXNSClient service | |
"%InstallDir%\AeXAgentUtil.exe" /Start | |
) | |
) | |
GOTO:EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment