Follow

Restart Agent Service via Agent Procedure

Problem

Due to agent procedure constraints, it is not possible to successfully restart the Kaseya Agent service on an endpoint

 

Resolution

The following agent procedure will successfully restart an agent service on the endpoint.

 

1) Step 1 - Identify the name of the Kaseya Agent Service you want to restart:

12-18-2015_12-47-44_PM.png

 

2) Step 2 - Download and modify the attached RestartAgent.bat and confirm the file has the appropriate Agent Service name:

12-18-2015_1-42-12_PM.png

 

3) Step 3 - Upload the RestartAgent.bat to the kserver shared file directory:

12-18-2015_12-51-46_PM.png

12-18-2015_12-52-14_PM.png

12-18-2015_12-52-40_PM.png

 

4) Step 4 - Upload the attached Procedure Folder Restart Agent Service.xml by navigating to Agent Procedures>Manage Procedures>Schedule/Create and selecting the directory in which you would like to upload these procedures. Once selected, click on the Import Folder/Procedure Button and upload the xml:

12-18-2015_12-58-41_PM.png

 

5) Step 5 - Confirm the procedures uploaded successfully and both procedures are present:

12-18-2015_1-00-20_PM.png

 

6) Step 6 - Select the 0 - Run This procedure and select the agent(s) you wish to run this procedure on:

12-18-2015_1-01-15_PM.png

 

Note: We highly suggest against running this on more than a few agents at a time as the procedure writes files to endpoints and that could cause a large performance impact on your server.

 

After roughly 2 minutes, your agent should stop and start, you can confirm this by checking the agent logs located in Agent>Machine Status>Agent Logs:

12-18-2015_1-03-19_PM.png

 

A detailed description of what this procedure does is as follows:

  • A .bat file that stops and starts the agent service is written to the agent temp directory.
  • A command is sent to add a schedule to the Windows Task Scheduler with an arbitrary future date (01/01/2099)
  • A command is set to immediately execute the task.
  • The command executes in roughly 2 minutes.
  • The second procedure is scheduled to, after 3 minutes, to delete the task from the scheduler and the .bat script from the temp directory.

Please note, if the agent is experiencing any external issue that causes the starting or stopping process to fail or take too long, you may lose connectivity to the agent, please run this procedure understanding that risk. In these cases, it will be necessary to manually start the service.

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.