1. Net start/stop w3svc
This command is mainly used to enable/stop the 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: Do not mix W3SVC with a website. If net stop W3SVC is enabled, all websites on the server are stopped. Of course, we can also stop a website. This is the next command.
2. iisweb.
This command is used to control all website-related operations, such as 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 /?
For example:
I want to create a website named Putuo with the port number 80 and IP address 159.60.60.117. The apppool used is myapppool, and the file is located in c: \ inetput \ wwwroot \ Putuo.
Syntax is as follows:
Iisweb/create c: \ inetput \ wwwroot "putup"/I 157.60.68.117/B 80/AP Putuo
3 iisapp
This command mainly targets some apppool operations.
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. sort 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. sort f a PID is given
For a web garden, I. e. An application pool served
By more than one w3wp, then all w3wp mandatory for that
Application pool will be acted.
/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
This command is mainly used to execute backup and restore operations on the IIS configuration file.
C: \ windows \ system32> iisback/backup /?
Description: backup the IIS server (des 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
Provided Password
/Overwrite back up even if a backup of the same
Name and version exists in
Specified location, overwriting if
Necessary. [Default: Disabled]
Examples:
Iisback/backup
Iisback/s server1/u administrator/P @ ssw0rd/backup/B newbackup
5 iisvdir
This command is mainly used to create/delete/query virtual directories.
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 /?