SureMDM Agent service needs to be running on the Windows machine in order to communicate to the server to update its status. In some cases, there will be chances that the SureMDM Agent gets killed accidentally in turn losing the connection to the server. This results in the administrator manually enable the service on the windows machines. This is good only when the machines are accessible nearby else 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 it gets killed by unknown actions the administrator will not lose the connection to the device.
How to set the SureMDM Agent service to restart remotely?
Below are the steps.
- Log into the SureMDM web console and click Jobs.
- Click New Job and select the OS as Windows.
- 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>
Please refer to the below example where the restart time is set to 1 min and in terms of milliseconds and reset time is set to 24 hours and 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 min and reset the timer to 24 hours to ensure the device comes back in touch with SureMDM as soon as possible.