Stopping/Starting services on a cluster through a command line

Posted on 2006-04-27
Last Modified: 2010-04-18
I need to write a simple batch file to copy some files from a cluster to another machine.  Before these files can be copied, a service needs to be stopped.  (I'll then need to re-start the service after the file copy).

If I just use the usual net stop command, the service will just fail over to the other node, correct?  If that happens, then the files I need to copy will still be locked.

Is there a command that I can use instead of net stop?  Something specific to shutting down a service on a cluster?
Question by:dsdonut
    LVL 95

    Expert Comment

    by:Lee W, MVP
    the command line control for a Windows Cluster is quite extensive.  Review this link for a much more detailed description of all the capabilities available:
    LVL 82

    Accepted Solution

    You need to take the service resource offline; this will stop the service. Then copy your files, and bring the resource online again.
    The command to stop the service should be
    cluster.exe /cluster:YourClusterName resource YourServiceResourceName /offline
    and to start it again
    cluster.exe /cluster:YourClusterName resource YourServiceResourceName /online
    Depending on how fast the service is doing the starting or stopping, you might have to add a "/wait:TimeOut"; default is 10 seconds.
    LVL 95

    Expert Comment

    by:Lee W, MVP
    Wow... so I provide an indepth link to how to use the cluster command line and get nothing for it... oh well...

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
    by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now