window系統下 IIS 相關命令和工具介紹

來源:互聯網
上載者:User
1. net start/stop w3svc
這個command主要用於開啟/停止服務 www service
    this command is used to start or stop www service. it commonly uses to reset w3svc after the  IIS configuration is modified.  
    notes: 不要w3svc和當個website搞混了。如果net stop w3svc,那麼位於該server上的所有website都被stopped。 當然,我們也可以單獨停掉某個website. 這就是下一個command 了

2. iisweb.

這個command用來控制所有和website相關的操作,比如create website,delete website, stop/pause website 等等。Description: Start, Stop, Pause, Delete, Query, or Create a   Web Site
Syntax:
 IIsWeb [/s <server> [/u <username> [/p <password>]]]   /<operation> [arguments]
Parameters:
Value                   Description
/s <server>             Connect to machine <server>                        [Default: this system]
/u <username>           Connect as <domain>\<username> or                        <username> [Default: current user]
/p <password>           Password for the <username> user
<operation>             /start   Starts a site(s) on given IIS Server.
                               /stop    Stops a site(s) from running on a given IIS Server.
                              /pause   Pauses a site(s) that is  running on a given IIS Server.
                             /delete  Deletes IIS configuration  from an existing Web Site. Content will not be deleted.
                            /create  Creates a Web Site.
                             /query   Queries existing Web Sites.
For detailed usage:
IIsWeb /start /?
IIsWeb /stop /?
IIsWeb /pause /?
IIsWeb /delete /?
IIsWeb /create /?
IIsWeb /query /?
例如:
我想建立一個名為putuo的website, 其連接埠號碼80, ip 地址:159.60.60.117,使用的appPool是myAppPool,檔案位於c:\inetput\wwwroot\putuo
則其syntax 如下:
iisweb /create c:\inetput\wwwroot "putup"  /i 157.60.68.117  /b 80 /ap putuo

3 iisapp
這個command主要是針對AppPool的一些操作

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.營f 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.營f a PID is given
                   for a web garden, i.e. an application pool served
                   by more than one w3wp, then all w3wp抯 for that
                   application pool will be acted upon.
/r                 Recycles the application pool.

DEFAULT: no switches will print out the PID and AppPoolId.

Examples:
IIsApp
IIsApp /p 2368
IIsApp /a DefaultAppPool /r
IIsApp /p 2368 /r

4 iisback
這個command主要用來執行對iis設定檔的backup,restore等等。
C:\WINDOWS\system32>iisback /backup /?
Description: Backup the IIS Server (includes all site data
             and settings).

Syntax: IIsBack [/s <server> [/u <username> [/p <password>]]]
        /backup [/b <BackupName>] [/v <VersionNumber>]
         [/e <BackupPassword>] [/overwrite]

Parameters:

Value                   Description
/s <server>             Connect to machine <server>
                        [Default: this system]
/u <username>           Connect as <domain>\<username> or
                        <username> [Default: current user]
/p <password>           Password for the <username> user
/b <BackupName>         Description for the backup file.
                        [Default: "SampleBackup"]
/v <VersionNumber>      Specifies the version number to be
                        assigned to the backup. Can be any
                        integer, HIGHEST_VERSION, or
                        NEXT_VERSION. [Default: NEXT_VERSION]
/e <BackupPassword>     Encrypt the backup file with the
                        provided password
/overwrite              Back up even if a backup of the same
                        name and version exists in the
                        specified location, overwriting if
                        necessary. [Default: disabled]

Examples:

IIsBack /backup
IIsBack /s Server1 /u Administrator /p p@ssW0rd /backup /b NewBackup

 5 iisvdir
這個command 主要用於建立/delete /query 虛擬目錄
Description: Create, delete, or query a web directory

Syntax: IIsVDir [/s <server> [/u <username> [/p <password>]]]
        /<operation> [arguments]

Parameters:

Value                   Description
/s <server>             Connect to machine <server>
/u <username>           Connect as <domain>\<username> or
                        <username> [Default: current user]
/p <password>           Password for the <username> user
<operation>             /create  Creates a web virtual directory
                                 on a specified web site.
                        /delete  Deletes a web virtual directory
                                 from a specified web site.
                        /query   Lists all virtual directories
                                 under the specified path.

For detailed usage:

IIsVDir /create /?
IIsVDir /delete /?
IIsVDir /query /?

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.