1. Home
  2. Knowledge Base
  3. SureMDM
  4. Windows Management
  5. How to restart the SureMDM Agent Service if it gets killed on Windows devices

How to restart the SureMDM Agent Service if it gets killed on Windows devices

The SureMDM Agent service needs to be running on the Windows machine in order to communicate with the server and update its status. In some cases, there will be chances that the SureMDM Agent gets killed accidentally, losing the connection to the server. This results in the administrator manually enabling the service on the Windows machines. This is good only when the machines are accessible nearby; otherwise, it will cost the administrator or organization to travel to a remote device location and enable it.

To avoid such situations, we can set the SureMDM Agent service to restart within a defined time so that even if it gets killed by unknown actions, the administrator will not lose the connection to the device.

Purpose

The purpose of this article is to provide a guide on how to restart the SureMDM Agent Service if it gets killed on Windows devices.

Prerequisites

NA

Steps

  1. Log into the SureMDM web console.
  2. Navigate to the Jobs section.
  3. Click New Job and select the OS as Windows.
  4. Select Run Script to create a run script job with the below command.
sc failure NixService actions=restart/<time in milliseconds>/restart/<time in milliseconds>/restart/<time in milliseconds> reset=<time in seconds>
  1. Please refer to the below example, where the restart time is set to 1 minute in terms of milliseconds and the reset time is set to 24 hours in terms of milliseconds.
sc failure NixService actions=restart/60000/restart/60000/restart/60000 reset=86400

Also, it is suggested to set the restart timer to 1 minute and reset the timer to 24 hours to ensure the device comes back in touch with SureMDM as soon as possible.

Need more help?

CONTACT US 

Was this helpful?
YesNo
Updated on August 2023