What's the easiest programmatic way to restart a service on a remote Windows system? Language or method doesn't matter as long as it doesn't require human interaction.
Windows – Simplest way to restart service on a remote computer
windowswindows-services
Related Question
- Windows – Quickly create large file on a Windows system
- .net – Install Windows Service with Recovery action to Restart
- Restart Windows Service From Service
- Windows – Create Windows service from executable
- C# – Windows service on Local Computer started and then stopped error
- Windows – Start/Stop and Restart Jenkins service on Windows
- How to solve “The specified service has been marked for deletion” error
- Windows – How to restart a windows service using Task Scheduler
Best Solution
As of Windows XP, you can use
sc.exe
to interact with local and remote services. Schedule a task to run a batch file similar to this:Make sure the task runs under a user account privileged on the target server.
psservice.exe
from the Sysinternals PSTools would also be doing the job: