0

How can I start a service from the command line e.g. net start "sql server (sqlexpress2016)" without running with elevated privileges?

The short answer is "you can't".
But how come then Services services.msc can start the same service without elevated privileges?
Is there a way to mimic this through the command line?

Clarification:
I am not looking for a way to change the service's security level but more like something on the command prompt like C:\>win-su net start SqlServer2016. where win-su has the rights and super powers to automagically recognise me as an admin and raise the security level for the net process.

  • You should have a look here where this should be answered: stackoverflow.com/questions/15496893/… – Chris Aug 30 '17 at 6:37
  • services.msc DOES run elevated; it requests elevation automatically, and gets it silently unless you crank UAC up to 'always notify'. Whereas CMD by itself can't request elevation, although it can run VBS and PS methods that do. – dave_thompson_085 Aug 30 '17 at 7:31
  • @dave_thompson_085 I guess services.msc is set at windows-install time to allow for automatic elevation then. That's fair. I was thinking of dropping this Q and ask another one how to raise privilege through Powershell, without confirmation or admin pwd, just as services.msc? I guess I won't since, if I understand correctly, that is not possible without changing UAC or writing script files to execute in elevated mode; which brings me back to square one. If my thoughts are correct, that it cannot easily be done, please write that as an answer so I can acknowledge it. – LosManos Aug 30 '17 at 7:45
0

You can change the local security policy settings (run secpol.msc, or create a GPO)

Go to Security Setting -> System Services and open the properties of the service. Then, you can change permission as desired.

service.msc uses elevated privileges, but the prompt is not shown since UAC is set on "level 3" and not 4 on your computer:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.