Netstart Netstop?

  • We want our operators to be able to stop and restart services on a Sql Server (2000). And that's all we want them to be able to do. We don't want them to Terminal Server into the box and we don't want to give them client tools or anything similar.

    What's the best way to do this? I'm ignorant about Netstop/Netstart - can they just run these from a command line on their personal machine and start/stop Sql Server services using Windows Authentication (assuming they have permissions)? Or do we need to use a Custom Snap In/Taskpad?

  • You can run it from the command line. It's actually a better way to manually start SQL server than running the executable directly, IMHO.

    Syntax looks like

    NET START servicename

    NET STOP servicename

    In the case of SQL Server, the service name is built as such

    MSSQL($name of the instance)

    So in my case, my instance is called SQLEXPRESS, so my start and stop command would look like:

    NET START MSSQL$SQLEXPRESS

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Matt Miller (11/30/2007)


    You can run it from the command line. It's actually a better way to manually start SQL server than running the executable directly, IMHO.

    Syntax looks like

    NET START servicename

    NET STOP servicename

    In the case of SQL Server, the service name is built as such

    MSSQL($name of the instance)

    So in my case, my instance is called SQLEXPRESS, so my start and stop command would look like:

    NET START MSSQL$SQLEXPRESS

    I just opened up the services on non-used test server and noticed that the sql server service was called MSSQLSERVER. And this server only has one instance, so I ran the following from my laptop. (Note: I am VPN'd into our network and this server is within our network, i.e. it's not on the DMZ or anything.)

    net stop MSSQLSERVER$SERVERNAME

    I then got the message:

    "System Error 1060 has occurred. The specified service does not exist as an installed service."

    What am I doing wrong??

  • Best way to get the service name is to look at the properties of the service in the Control Panel/Administirative Functions, services. Highlight the service in question, right-click, properties, and it's the first thing up top....

    It usually should however be just MSSQL$something. Just take a look at what's there.

    Hang on though - if you DON'T want them to do this from the server console itself - you want to look at finding the SC utility which allows you to "send" the command to the remote server.

    You can acquire it here:

    ftp://ftp.microsoft.com/reskit/win2000/sc.zip

    Syntax looks like

    SC \\machine_name START "Service Name"

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Matt Miller (11/30/2007)


    Best way to get the service name is to look at the properties of the service in the Control Panel/Administirative Functions, services. Highlight the service in question, right-click, properties, and it's the first thing up top....

    It usually should however be just MSSQL$something. Just take a look at what's there.

    That's actually where I did look. But it's MSSQLSERVER both in the GUI and when I do right click/properties. I even ran NET START|more on a command line and it came up with that same name. Again, we only have one instance.

    any other ideas?

  • Took me a second to figure out you DON't wnat them there through remote desktop.

    Look at the updated post above.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Thanks! I did some googling and that looks like it has great potential. I'll check into it further...

  • Hey hey

    I am not sure about your environment but i can offer the advice of be careful as to having other stop and start the mssqlserver services. I know that in my situation that would or could cause un-needed stress due to lack of end-user knowledge. And i am sure many can attest to that. Also altho i am not positive i dont think net start and net stop are meant to be used in the manner you are looking for unless you start using virtual drives and all that. Just my .02

    -D-

    DHeath

  • Whisper9999 (11/30/2007)


    Matt Miller (11/30/2007)


    Best way to get the service name is to look at the properties of the service in the Control Panel/Administirative Functions, services. Highlight the service in question, right-click, properties, and it's the first thing up top....

    It usually should however be just MSSQL$something. Just take a look at what's there.

    That's actually where I did look. But it's MSSQLSERVER both in the GUI and when I do right click/properties. I even ran NET START|more on a command line and it came up with that same name. Again, we only have one instance.

    any other ideas?

    The default instance is always MSSQLSERVER. So the commands would be:

    net stop mssqlserver

    net start mssqlserver

    Another thing to consider is the rights required to stop/start services - generally having the rights to do that gives rights to do other things as well. Do you want your operators to have those rights? Or is it something that the DBA or sysadmins should really be doing? Or is it something that can be scripted/scheduled?



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply