How to: Allow users to start / stop (server) services

AID: 2092
  • Status: Published

4100 points

  • ByToretto
  • TypeTips/Tricks
  • Posted on2009-12-11 at 02:38:07
Awards
  • Community Pick
If you're working for a huge coorporation, you'll probably shiver at the idea of allowing any users to start or stop services on your Windows Servers.  In small companies, however, it's not always easy or even possible for the System Admin to follow the "perfect safety instructions".  

Take my example.  I work for a company, Drenco N.V.  Although we're active in different markets, there's only a few people that actually work at the main office.  Of those people, there's only one System Admin, and that's me.  So, if I want to have some rest during my vacations it's of the upmost importance that others can "fix" problems that occur.  

One of these errors happens to be the DNS server on our SBS 2003 box that occasionally needs a restart.  Just recently, I found a way to allow (trusted) users to stop / start this service (and other services), so they'll be able to perform this simple task, without much risk to the rest of the network.

Are you in a situation like mine? If you need certain non-admin users to be able to stop / start services on a Windows server, the following guide will be usefull to you.  

How to do it.

First of all, we need to install a component from the Microsoft Resource kit.  The file in question is SUBINACL.exe Link to the download:

  • If you've downloaded the file, install it on your server.  Note: choose an installation location that's easy to find.  You'll need to navigate there w/ the command prompt.  

  • Open your command prompt, and navigate to the folder where you installed the tool. (Default: c:\Program Files\Microsoft Resource Kit\Tools)

  • Run the following command - replace everything between ( ) with your own parameters and, obviously, get rid of the ( ).  
    SUBINACL /service \\(target machine)\(short name of service to restart) GRANT= (domain)\(user).  


Create a Batch job

  • Now that the server side is all taken care off, you'll want to make it as easy as possible for your user in question to start / stop the service.  Open notepad, and use the following lines:
    sc \\(target machine) (command) (service)

  • Save the file as (somename).bat and send it to the user; who then only needs to run the file.  


Examples:

  • For the SUBINACL command= SUBINACL /service \\192.168.0.200\DNS GRANT= toretto.local\Toretto

  • For the SC command (this .bat file would restart the DNS service on the target machine):  
    sc \\192.168.0.200 stop DNS
    sc \\192.168.0.200 start DNS


And that's it!  Remember, be carefull which rights you're giving to what user, the commands can be very powerful and a little dangerous in the wrong hands.  
Asked On
2009-12-11 at 02:38:07ID2092
Tags

remote

,

sc

,

services

,

start

,

stop

,

SUBINACL

,

users

,

Windows

,

non-admin

Topic

Microsoft Server

Views
3017

Comments

Expert Comment

by: Bobbyjgr63 on 2011-06-22 at 09:46:46ID: 28996

I received an error saying the Service does not exist but it does, I tryed the short name and full name of the servcie, same result

Expert Comment

by: sujithmd on 2012-03-01 at 21:07:13ID: 44519

Please provide the service name rather than the display name attaching a sample screenshot showing the service name and dispaly name.

Expert Comment

by: sujithmd on 2012-03-01 at 21:08:57ID: 44520

sorry attachment not wokring you can double click the service and see the service name and the display name

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top MS Server OS Experts

  1. dariusg

    58,461

    Master

    0 points yesterday

    Profile
    Rank: Genius
  2. arnold

    57,668

    Master

    0 points yesterday

    Profile
    Rank: Genius
  3. motnahp00

    50,665

    Master

    2,000 points yesterday

    Profile
    Rank: Sage
  4. leew

    40,767

    0 points yesterday

    Profile
    Rank: Savant
  5. kevinhsieh

    40,148

    0 points yesterday

    Profile
    Rank: Genius
  6. hanccocka

    34,426

    0 points yesterday

    Profile
    Rank: Genius
  7. ve3ofa

    34,100

    0 points yesterday

    Profile
    Rank: Genius
  8. mkline71

    33,216

    0 points yesterday

    Profile
    Rank: Genius
  9. CrisHanna_MVP

    31,910

    0 points yesterday

    Profile
    Rank: Genius
  10. alanhardisty

    28,899

    2,000 points yesterday

    Profile
    Rank: Genius
  11. demazter

    27,078

    10 points yesterday

    Profile
    Rank: Genius
  12. dstewartjr

    27,062

    0 points yesterday

    Profile
    Rank: Genius
  13. RobWill

    27,011

    0 points yesterday

    Profile
    Rank: Savant
  14. KCTS

    24,286

    0 points yesterday

    Profile
    Rank: Genius
  15. Anuroopsundd

    23,704

    0 points yesterday

    Profile
    Rank: Sage
  16. dvt_localboy

    21,632

    0 points yesterday

    Profile
    Rank: Sage
  17. oBdA

    18,800

    0 points yesterday

    Profile
    Rank: Savant
  18. cgaliher

    18,768

    0 points yesterday

    Profile
    Rank: Genius
  19. Geodash

    18,288

    0 points yesterday

    Profile
    Rank: Guru
  20. pwindell

    16,050

    0 points yesterday

    Profile
    Rank: Genius
  21. fl_flyfishing

    15,300

    0 points yesterday

    Profile
    Rank: Wizard
  22. iSiek

    14,600

    2,100 points yesterday

    Profile
    Rank: Genius
  23. vadimrapp1

    14,560

    0 points yesterday

    Profile
    Rank: Genius
  24. Venurajav

    13,632

    0 points yesterday

    Profile
    Rank: Master
  25. andyalder

    13,100

    0 points yesterday

    Profile
    Rank: Genius

Hall Of Fame