Ghost Solution Suite

 View Only
  • 1.  reset inactive client remotely

    Posted Jun 04, 2023 01:29 AM


    I have a problem with the agent, sometimes it shows on ghost console that the pc is inactive while the pc is on and the agent is connect. reboot the client resolve this issue but there is a command or PowerShell script to remotely reset the agent instead doing reboot every time that is happen?

  • 2.  RE: reset inactive client remotely

    Posted Jun 05, 2023 06:44 AM
    I have seen that issue for a long time. I use a scheduled task to restart the Dagent, triggered when the computer wakes up from sleep. Has worked great for us for many years now.


  • 3.  RE: reset inactive client remotely

    Posted Jun 05, 2023 08:53 AM
    Edited by sasi mizrahi Jun 05, 2023 08:54 AM
    Thank you very much for the answer Andrew but can you please send more details and instructions on how to do it in a the task scheduler? I would be really grateful.

  • 4.  RE: reset inactive client remotely

    Posted Jun 05, 2023 09:19 AM
    Sure thing:
    I have a job I run from Ghost, just a script to import the task.
    GSS Script Job:
    @echo off
    REM Create Task to restart Altiris agent from sleep.

    schtasks /Create /RU USERWITHRIGHTS /RP PASSWORDFORUSER /TN "Dagent Restart" /XML "\\*SERVER*\eXpress\Software\Scripts\AltirisAgentRestart\Dagent Restart.xml"

    The XML file (Dagent Restart.xml) creates the task on the computer.

    <task version="1.2" xmlns="">
    <description>Restarts the Altiris Dagent after waking up from sleep.</description>
    <uri>\Dagent Restart</uri>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Kernel-Power'] and EventID=107]]</Select></Query></QueryList></subscription>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Kernel-Power'] and EventID=131]]</Select></Query></QueryList></subscription>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter'] and EventID=1]]</Select></Query></QueryList></subscription>
    <principal id="Author">
    <actions context="Author">


    I created the task on a computer and exported to XML to use for the import job. 3 triggers:
    on event:
          Log: system
          Source: Kernel-Power
          Event ID: 107

          Log: system
          Source: Kernel-Power
          Event ID: 131

          Log: system
          Source: Power-Troubleshooter
          Event ID: 1

    Delay for 2 min

    Start a program:
          Script on network

    cmd file on the server the task runs:
    sc stop "Altiris Deployment Agent"
    ping -n 8 -w 1000 > nul
    sc query "Altiris Deployment Agent" | find /I "STATE" | find "STOPPED"
    if errorlevel 1 goto :stop
    goto :start
    net start | find /i "Altiris Deployment Agent">nul && goto :start
    sc start "Altiris Deployment Agent"

    Hope that helps!


  • 5.  RE: reset inactive client remotely

    Posted Jun 05, 2023 10:25 AM

    Thank you very much, it works great!