コマンドライン経由で IIS 上の特定のアプリ プールをリモートで再起動するにはどうすればよいですか?

コマンドライン経由で IIS 上の特定のアプリ プールをリモートで再起動するにはどうすればよいですか?

私はボックスの管理者であり、ボックスにログインせずに特定のアプリ プールを停止/開始したいと考えています。

このタスクを実行するためのコマンド ラインはありますか?

答え1

マシン上にいる場合は、次のコマンドで実行できます。これはリモート コマンドではありません。ただし、Web サーバーに 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.

関連情報