79487125

Date: 2025-03-05 16:47:22
Score: 1
Natty:
Report link

Many answers were already provided, including usage of

net stop Jenkins
net start Jenkins

and

sc stop Jenkins
sc start Jenkins

The problem is that on modern Windows (i.e. Windows 10 and higher) the Jenkins-own security policies "merges" with Windows Security policies and it become to be "hard, up to impossible" to start/stop Jenkins from command line without starting the command-line interface as administrator.

On other hand - it's not a good idea to provide administrator rights for user, who just should stop/start single Jenkins service.

In the answer linked below I've referenced a new article from Microsoft, which describes how to allow for concrete user to start/stop concrete service (e.g. Jenkins) without providing administrator rights for this user. So the user-account will be able to start/stop Jenkins from command line without need to open command line interface as administrator, neither accepting UAC message in GUI. It's quite useful for maintenance scripts. I've also provided some additional hints regarding the steps described by Microsoft in the named article. Here is the link to my answer:

https://stackoverflow.com/a/79486876/19041857

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Blacklisted phrase (1): Here is the link
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dr.CKYHC