Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

The title says it all. I need to be able to start and stop a specific service via the normal (non-administrator) command prompt. Is there a way to give access to one user to start and stop this specific service with net start/stop? Currently I just get "access denied".

share|improve this question

5 Answers 5

No. This is a security feature built into server 2008. You can open an elevated prompt by simply right clicking the CMD program icon and selecting run as administrator. (provided you are in fact an administrator!)

share|improve this answer
    
I know how to open an elevated prompt. But I need to do this from a normal prompt. In the end, I need to do it remotely. –  Matthew Talbert Sep 21 '10 at 9:25
    
I dont recomend this but the only other thing you could do is disable 'User Access Control' this can be done via the control panel > select Control Panel Home and in the search box on the top right type UAC - the rest is simple. Why are you using a batch file to do this? does computer management not do this for you? –  JamesK Sep 21 '10 at 10:12
    
I don't want to turn off User Access Control. I am doing this because I need to stop and then restart a service as part of a build and deployment process. –  Matthew Talbert Sep 21 '10 at 10:21
    
Would it not make more sense to create and execute a powershell script? –  JamesK Sep 21 '10 at 11:44
2  
Another idea could you not have your deployment create a scheduled task to execute the batch file as system or another administrator user? –  JamesK Sep 21 '10 at 11:46

I use SlickRun (Bayden Systems) to launch a command window that has Administrator privileges. http://www.bayden.com/SlickRun/

share|improve this answer
    
I need to do this non-interactively. –  Matthew Talbert Sep 21 '10 at 10:30

You might take a look at PsService. It will allow you to specify a user as well as control a service remotely.

share|improve this answer
    
I believe that PsService will no longer do this in a Server 2008 environment. I think that I tried it, though I can't remember right now. –  Matthew Talbert Sep 8 '11 at 4:19

Here's a three-step process.

net use \\ip\ipc$ * /user:username
sc \\ip stop service
sc \\ip start service

The first command establishes credentials with the server in question. If both are on the same domain and you're a domain admin/have administrator rights, then you may be able to exclude the first command. Replace * with the password for no prompt (insecure!!).

share|improve this answer

I know this is really old but I faced the same situation, and hopefully this will help someone else who stumbles upon it. You in fact CAN use Net Start/stop from a non-admin command prompt.

You must first add "everyone" to the service and give it start/stop permissions.

share|improve this answer
6  
Oh man. While that will work, that's a dangerous proposition. You're allowing anyone - authenticated or not - to kill a service at will. Yikes. –  MDMarra May 31 '13 at 14:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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