在多个Windows服务器上运行命令

时间:2022-08-29 01:14:11

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.

我维护了许多运行Windows Server 2003的负载均衡的Web服务器。今天,当我想对这些服务器进行更改时,我使用了一个繁琐的过程,即打开与每个服务器的远程桌面连接,然后从命令提示符运行命令在每台服务器上。这需要很多时间。

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.

我想要做的是在一个*服务器上运行命令或编写脚本,该服务器访问每个其他Windows服务器并在每个服务器上运行相同的命令。在这种情况下,我希望在5到10台服务器上运行该命令,但可能不超过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.

复制文件重新编译 - 我们已经在每个服务器上都有一个.bat文件。源控制(SVN)签出或更新。可以从windows命令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.

我知道如何在Linux / Unix中使用SSH执行此操作,因此请做出切换到Linux的答案。

Thanks in advance for the help.

在此先感谢您的帮助。

3 个解决方案

#1


You could try SysInternals PsExec.

你可以试试SysInternals PsExec。

#2


#3


Install a RSH server on Windows.

在Windows上安装RSH服务器。

RSH originally existed under UNIX and so is also present under Linux.

RSH最初存在于UNIX下,因此也存在于Linux下。

I used this solution about ten years ago for a distributed build system, which concurrently built a couple of applications on Windows, Solaris and HPUX. An RSH server ran on each machine and the controlling machine issued commands to them.

大约十年前,我使用这个解决方案来建立分布式构建系统,该系统同时在Windows,Solaris和HPUX上构建了几个应用程序。在每台机器上运行RSH服务器,控制机器向它们发出命令。

We used a third party RSH server, the name of which escapes me.

我们使用了第三方RSH服务器,其名称逃脱了我。

Windows Server used to ship with an RSH demon, but I think it's just been removed from the build.

Windows Server曾经附带RSH恶魔,但我认为它刚从构建中删除。

#1


You could try SysInternals PsExec.

你可以试试SysInternals PsExec。

#2


#3


Install a RSH server on Windows.

在Windows上安装RSH服务器。

RSH originally existed under UNIX and so is also present under Linux.

RSH最初存在于UNIX下,因此也存在于Linux下。

I used this solution about ten years ago for a distributed build system, which concurrently built a couple of applications on Windows, Solaris and HPUX. An RSH server ran on each machine and the controlling machine issued commands to them.

大约十年前,我使用这个解决方案来建立分布式构建系统,该系统同时在Windows,Solaris和HPUX上构建了几个应用程序。在每台机器上运行RSH服务器,控制机器向它们发出命令。

We used a third party RSH server, the name of which escapes me.

我们使用了第三方RSH服务器,其名称逃脱了我。

Windows Server used to ship with an RSH demon, but I think it's just been removed from the build.

Windows Server曾经附带RSH恶魔,但我认为它刚从构建中删除。