如何通过命令行远程重启IIS上的某个应用程序池?

我是一个框中的pipe理员,并希望停止/启动某个应用程序池,而无需login到框中。

有没有一个命令行来完成这个任务?

如果你在机器上,下面的命令可以完成它。 现在,这不是一个远程命令。 但是如果你有CIFS在networking服务器上开放,你可以使用PSEXEC。 如果您不能/不想要RDP或PSEXEC到服务器,您也可以通过telnet或SSH调用它,如果您启用/安装了这些协议。

C:\WINDOWS\system32>iisapp.vbs /? Description: list IIS application pools and associated worker processes. Recycle application pools. Syntax: IIsApp.vbs [{ /a <app_pool_id> | /p <pid> } [/r] ] Parameters: Value Description /a <app_pool_id> Specify an application pool by name. Surround <app_pool_id> with quotes if it contains spaces. If used alone without an accompanying action, IIsApp.vbs will report PIDs of currently running w3wp.exe processes serving pool <app_pool_id>. /p <pid> Specify a process by process ID. If used alone without an accompanying action, IIsApp.vbs will report the AppPoolId of the w3wp process specified by <pid>. When a PID is specified with /r, that PID is mapped to an application pool and the action is taken upon the application pool. If a PID is given for a web garden, ie an application pool served by more than one w3wp, then all w3wp's for that application pool will be acted upon. /r Recycles the application pool. DEFAULT: no switches will print out the PID and AppPoolId.