window系统下 IIS 相关命令和工具介绍
这个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 /?