如何透過命令列遠端重啟 IIS 上的某個應用程式集區?

如何透過命令列遠端重啟 IIS 上的某個應用程式集區?

我是盒子的管理員,想停止/啟動某個應用程式集區而無需登入盒子。

有命令列來完成這個任務嗎?

答案1

如果您在電腦上,則下列命令可以執行此操作。現在,這不是遠端命令。但如果您向網路伺服器開放 CIFS,則可以使用 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, i.e. 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.

相關內容