Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop service on several W2K3 servers

Status
Not open for further replies.

getndz

IS-IT--Management
Jul 25, 2007
162
CH
Hello,

I would like to stop (and restart later) the same services on several servers in the same domain and at the same time.
Someone know has an idea how I could do it witch a batch file ?
Thanks to all
getndz
 
Although there are many ways to do this the simplest would be to create two batch files (one to stop and one to restart the services) as follows;

batch file 1
net stop <service1>
sleep 10 **Sleep command avail from reskit
net stop <service2>
:
:

batch file 2
net start <service1>
sleep 10 **Sleep command avail from reskit
net start <service2>
:
:

Copy the batch files to each server and setup a scheduled task to run each batch file at pre-determined time
 
Hello itsp1965 ,

Thank You but I would like to start a batch from the MGMT server and use i.e. a server list.
There are about 50 servers :-((

regards
getndz
 
use psexec to execute the example batch jobs (or something like them) provided by itsp1965



You can have psexec read a file containing a list of computer names

Paul
VCP4

RFC 2795 - The Infinite Monkey Protocol Suite (IMPS)

Difficult takes a day, impossible takes a week
 
Thank You...
PSEXEC question.
I must stop some services (still the sames) on several servers in the domain.
My idea is to use a txt file containing the servers' names and "net stop" in a batch file i.e "stopsvc.bat".
Is it necessary to copy "stopsvc.bat" on all the servers ???

regards
getndz
 
Hello,

I'm trying to use psexec.
I've created a txt file with all the server names in it.
And a batch file with the net stop commands.

Start: psexec @allservers.txt -c stopsvc.bat

Result: the job is searchig for the first server and than it stops.
No error messages
What's wrong ???
Thank you
getndz
 
It's a great tool but I must start or stop several services on 50 servers..
I do not believe it's theright one.

Thank you for the tip
 
I do not know the, but I'll check it....
 
Thanks to all, I used psexec and it did.

psexec @allservers.txt -stopservices.bat ( or "stop.....bat)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top