Ghost Solution Suite

 View Only
  • 1.  reset inactive client remotely

    Posted Jun 04, 2023 01:29 AM

    Hello,

    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.

    Andrew




  • 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="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <registrationinfo>
    <date>2017-02-17T14:13:44.528469</date>
    <author>*********</author>
    <description>Restarts the Altiris Dagent after waking up from sleep.</description>
    <uri>\Dagent Restart</uri>
    </registrationinfo>
    <triggers>
    <eventtrigger>
    <enabled>true</enabled>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Kernel-Power'] and EventID=107]]</Select></Query></QueryList></subscription>
    <delay>PT2M</delay>
    </eventtrigger>
    <eventtrigger>
    <enabled>true</enabled>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Kernel-Power'] and EventID=131]]</Select></Query></QueryList></subscription>
    <delay>PT2M</delay>
    </eventtrigger>
    <eventtrigger>
    <enabled>true</enabled>
    <subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter'] and EventID=1]]</Select></Query></QueryList></subscription>
    <delay>PT2M</delay>
    </eventtrigger>
    </triggers>
    <principals>
    <principal id="Author">
    <userid>*********</userid>
    <logontype>Password</logontype>
    <runlevel>LeastPrivilege</runlevel>
    </principal>
    </principals>
    <settings>
    <multipleinstancespolicy>IgnoreNew</multipleinstancespolicy>
    <disallowstartifonbatteries>false</disallowstartifonbatteries>
    <stopifgoingonbatteries>false</stopifgoingonbatteries>
    <allowhardterminate>true</allowhardterminate>
    <startwhenavailable>false</startwhenavailable>
    <runonlyifnetworkavailable>false</runonlyifnetworkavailable>
    <idlesettings>
    <stoponidleend>true</stoponidleend>
    <restartonidle>false</restartonidle>
    </idlesettings>
    <allowstartondemand>true</allowstartondemand>
    <enabled>true</enabled>
    <hidden>false</hidden>
    <runonlyifidle>false</runonlyifidle>
    <waketorun>false</waketorun>
    <executiontimelimit>PT72H</executiontimelimit>
    <priority>7</priority>
    </settings>
    <actions context="Author">
    <exec>

    </exec>
    </actions>
    </task>

    I created the task on a computer and exported to XML to use for the import job. 3 triggers:
    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

    Action:
    Start a program:
          Script on network

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

    Hope that helps!




    Andrew






  • 5.  RE: reset inactive client remotely

    Posted Jun 05, 2023 10:25 AM

    Thank you very much, it works great!