應用到: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
Adsutil.vbs 是一個 IIS 管理實用程序,它通過結合使用 Microsoft Visual Basic Scripting Edition (VBScript) 與 Active Directory 服務界面 (ADSI) 來處理 IIS 配置。該腳本應通過隨 Windows 腳本主機一同安裝的 CScript 運行。
重要事項
只有本地計算機上 Administrators 組的成員才能運行腳本和可執行文件。作為安全性最佳操作,請使用不屬于 Administrators 組的帳戶登錄計算機,然后使用 runas 命令以管理員身份運行腳本或可執行文件。在命令提示符下,鍵入 runas /profile /user:mymachine/administrator cmd,使用管理員權限打開一個命令窗口,然后鍵入 cscript.exe ScriptName(包括腳本的完整路徑和任何參數)。
使用
Cscript.exe adsutil.vbs COMMAND <path> [<param>...]
Cscript.exe adsutil.vbs COMMAND [<path> [<parameters>...]]
命令 | 描述 |
---|---|
GET Path | 顯示選擇的參數。 |
SET Path Value | 指定新值。 |
ENUM Path "/P" | 枚舉該路徑的所有參數。/P 僅枚舉路徑(無數據)。 |
ENUM_ALL "/P" | 枚舉所有參數。/P 僅枚舉路徑(無數據)。 |
DELETE Path | 刪除路徑或參數。 |
CREATE Path [KeyType] | 創建路徑并為其分配 KeyType。 |
APPCREATEINPROC Path | 創建進程內應用程序。 |
APPCREATEOUTPROC Path | 創建進程外應用程序。 |
APPDELETE Path | 刪除應用程序(如果存在)。 |
APPUNLOAD Path | 卸載進程外應用程序。 |
APPGETSTATUS Path | 獲取應用程序狀態。 |
FIND Path | 查找設置了參數的路徑。 |
START_SERVER Path | 啟動網站。 |
STOP_SERVER Path | 停止網站。 |
PAUSE_SERVER Path | 暫停網站。 |
CONTINUE_SERVER Path | 網站取消暫停。 |
HELP | 打印所有可用命令。 |
注意
•<Path> 是指要設置其屬性(包括要設置的屬性名稱)的節點路徑。例如,要將 ServerComment 設置為“Web Server Number 1”,則命令如下:
adsutil SET w3svc/1/ServerComment "Web Server Number 1"
下一次打開 IIS 管理器時,Web 服務器的名稱將變為“Web Server Number 1”。
•為了在遠程計算機上執行開關“-s:server name”,可以在任何命令后面使用該命令。(參見下面第一個示例。)
示例
•Cscript.exe adsutil.vbs GET W3SVC/1/ServerBindings -s:remotecomputer1
•Cscript.exe adsutil.vbs SET W3SVC/1/ServerBindings ":81:"
•Cscript.exe adsutil.vbs CREATE W3SVC/1/Root/MyVdir "IIsWebVirtualDir"
•Cscript.exe adsutil.vbs START_SERVER W3SVC/1
•Cscript.exe adsutil.vbs ENUM /P W3SVC
新聞熱點
疑難解答