Solved

Restart a Generic Service in Windows 2003 Server

Posted on 2009-07-06
5
704 Views
Last Modified: 2012-05-07
Hi Experts,

Please can you assist in the scenario below?

We have a windows 2003 clustered server (2 nodes)

The cluster has a resource setup as a generic service.

We require the service to be restarted on a daily schedule.. can you advise the best way? With it being a clustered resource, does it make more difficult.

A scheduled task with a srcipt would be ideal.
Thankyou,




0
Comment
Question by:wk6838
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:marcustech
ID: 24786521
create a .bat file in note pad with

net stop "service name"
net start "service name"
(keep the speach marks " - and replace service name with the exact name of the service)

in schedualled tasks, set it to run at required time.

enoy
0
 
LVL 83

Accepted Solution

by:
oBdA earned 250 total points
ID: 24786536
This is a cluster; do NOT use "net stop" or "net start"!
You need to use cluster.exe to take the resource offline and then back online again:
REM stop the service:
cluster /cluster:<Clustername> res "<Some Generic Service>" /offline
REM start the service:
cluster /cluster:<Clustername> res "<Some Generic Service>" /online
0
 

Author Comment

by:wk6838
ID: 24789525
thanks for the comments. Yes it is a cluster.
oBdA > If I put the command in the script will it also bring down the dependancies?
0
 
LVL 83

Expert Comment

by:oBdA
ID: 24789683
It will take down all resources that are dependent on the service (but not resources that the service depends on).
If you have other resources that are dependent on this service, and you want to bring them all online after stopping the service, simply bring the whole group online:
cluster /cluster:<Clustername> group "<Some Resource group Name>" /online
0
 

Author Comment

by:wk6838
ID: 24821405
This has worked successfully thankyou
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

27 Experts available now in Live!

Get 1:1 Help Now