Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a command on multiple Windows servers

I maintain a number of load balanced web servers running Windows Server 2003. Today when I want to make a change to those servers, I use a tedious process of opening a remote desktop connection to each of those servers then running a command from the command prompt on each server. This takes a lot of time.

What I would like to do is run a command or write a script on one central server which accesses each of these other Windows servers and runs the same command on each of them. In this scenario I would want to run the command on 5 to 10 servers, but probably not more than 10.

The commands being run on the remote servers could be any of the following:

Copy a file Recompile - we already have a .bat file on each server for this. Source control (SVN) check out or update. Any other command that could be run from the windows command shell.

Also, I have domain administrator privileges as well as specific login and password info for each of these servers.

I know how to do this in Linux/Unix with SSH, so please do answers that say switch to Linux.

Thanks in advance for the help.

like image 596
Steve Stedman Avatar asked Jan 24 '23 18:01

Steve Stedman


2 Answers

You could try SysInternals PsExec.

like image 85
Dave Webb Avatar answered Jan 26 '23 09:01

Dave Webb


PSExec

like image 36
Alan Avatar answered Jan 26 '23 10:01

Alan