Why can't I restart a remote service from PRTG 7.2.4.5051 on a Windows 2008 R2 server, even though manual execution works fine? The issue might be related to permissions, especially since the notifications folder is under Program Files.
PTF Launcher
If the computer running the service has to be restarted has a user logged in, you can use PTF Launcher to start "net start <service>" on the specified computer in order to start the service.
Use the -c= parameter to specify the computer that has PTF Launcher running.
Enter the following parameters in the parameter section of the Launcher Custom Notification
-c=192.168.1.1 -s=net.exe -a=start <service>
Alternatively you can have PTF Launcher run a batch file that first stops the service with "net stop <service>" and than starts it again with "net start <service>".
@echo off rem stop the service net stop %1% > null rem wait 2 seconds ping 1.1.1.1 -n 1 -w 2000 > null rem start the service net start %1% > null
Save this file as restart.bat and use:
-s=c:\path_to_batch_file\restart.bat -a=sharedaccess
...to restart the Windows Firewall service.
Please see the readme.txt that is included in the download for more information.
Disclaimer:
The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.