Creating a Task to send a Server redirect
search cancel

Creating a Task to send a Server redirect

book

Article ID: 150154

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite

Issue/Introduction

The customer needs a task that will change the current SMP reference on the client machines: Redirect agents to a new SMP.

Environment

ITMS 8.x

Resolution

Run a Redirect Script on Clients

  1. Create a New Run Script task, Manage>Jobs and Tasks>Right-click and select New then Task.
  2. Scroll down and find Run Script, rename then copy and paste the following syntax into the box.

    REM Get the Altiris Agent install path
    FOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKLM\Software\Altiris\Altiris Agent" /V "installdir"') DO SET AgentDir=%%B
    set tempbat=%temp%\AgentRedirect.bat"

    REM Create temporary batch file to execute while the agent restarts
    echo ping localhost -n 30 >> %tempbat%
    echo "%AgentDir%\aexagentutil" /Server:FQDN of desired SMP > %tempbat%
    echo ping localhost -n 30 >> %tempbat%
    echo "%AgentDir%\aexagentutil" /restart >> %tempbat%
    echo exit >> %tempbat%
    REM Executes temporary batch file
    start "" /MIN %tempbat%
     
  3. Click on 'Advanced...' under the 'Script Details' section and under the 'Script' tab change to "Hidden" under the 'Other' section.
  4. Then click OK, and 'Save changes'.
  5. Scroll down to New Client Job, click Add Existing.
  6. Select the Run Script you just created, and click OK.
  7. Uncheck the box-Fail Job if any Task fails, Save Changes.
  8. Click New Schedule, at this point, you can put in a schedule or "Run it Now".
    Note: Only run this job once, No Repeat. Click Add and put in your Target or Computers. Click the Schedule button and you are done. It runs according to what you just set.

Note: The Cleanup Script below does have a pop-up window the user will see. A pop-up will be up for 1-10 seconds, then runs in the background. Runs up to two minutes, and the agent will disappear in this process. The process is completed when the agent is visible again