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.
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
Original Message:
Sent: 6/5/2023 8:53:00 AM
From: sasi mizrahi
Subject: RE: reset inactive client remotely
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.
Original Message:
Sent: Jun 05, 2023 06:43 AM
From: Andrew Pratt
Subject: reset inactive client remotely
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
Original Message:
Sent: 6/4/2023 1:29:00 AM
From: sasi mizrahi
Subject: reset inactive client remotely
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?