Stopping/Starting services on a cluster through a command line

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?
dsdonutAsked:
Who is Participating?
 
oBdAConnect With a Mentor Commented:
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.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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:
http://technet2.microsoft.com/WindowsServer/en/Library/62513114-6281-4119-8a65-6463be5646a61033.mspx
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Wow... so I provide an indepth link to how to use the cluster command line and get nothing for it... oh well...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.