One: the preparatory work
APPcmd.exe in the C:\Windows\System32\inetsrv directory
Switch to this directory using Cd c:\Windows\System32\inetsrv
II: Introduction to command operations
IIS Command-Line administration Tool basic format:
APPCMD (command) (object type) < identifier > </parameter 1: value 1 ...>
Supported Object types:
Management of Site virtual sites
App Management app
VDIR Managing virtual Directories
AppPool Managing Application Pools
Config Management General configuration section
WP Management work Process
Request to manage HTTP requests
Module Management Server Modules
Backup Management Server Configuration Backups
Trace logs using failed request tracing
-----------This does not explain very detailed, understand the people know this level of IIS.
Three: A detailed command of the Site
1. Command Introduction
Management of virtual sites
APPCMD < commands > site [identifier] [-Parameter 1: value 1 ...] such as: APPCMD list site (lists the currently existing sites)
Supported commands:
List List Virtual sites
Set Configuration virtual site
Add New virtual site
Delete Deletes a virtual site
Start Startup virtual site
Stop stopping a virtual site
2. Detailed
List Virtual Sites
APPCMD list SITE [identifier] [-Parameter 1: value 1 ...]
Lists the virtual sites on the computer. This command can be used to find the site using the identifier or URL of a specific site, or
Matches 0 or more sites based on a specified site property.
Example:
Appcmd List Sites
Lists all sites on the computer.
Appcmd list Site "Default Web site"
Find the Site "Default Web site".
Appcmd List Site Http://localhost/app1
Finds the site associated with the specified URL.
Appcmd List Site/serverautostart:false
Look for all sites that have the "ServerAutoStart" configuration Property set to "false".
Add a new virtual site
APPCMD add SITE [identifier] [-Parameter 1: value 1 ...]
Creates a new virtual site with the specified settings. At a minimum, the site name and ID must be provided.
Supported parameters:
/name (required) Site name
/ID Site ID
/bindings "Http://domain:port,..." friendly format or "protocol/bindinginformation,..." binding list in original format
/physicalpath
If specified, causes the root application to be created for the site that contains the root virtual directory that points to the specified path. If you suddenly
, a site without a root application will be created, and the site will not start until the root application is created.
Example:
Appcmd add Site/name: "My New site"/id:2/bindings:http://www.domain.com:80
Creates a new site "My new site" with the specified good-memory bindings to listen on port 80 on the WWW.D
HTTP request for omain.com.
Appcmd add Site/name: "My New site"/id:2/bindings:http://*:81
Creates a new site "My new site" with the specified good-memory bindings to listen on port 81 on any domain
HTTP request for the name.
Appcmd add Site/name: "My New Site"/id:2/bindings:http/*:81:
Creates a new site, my new site, with the specified ID and bindings. After creation, no apps are included in the new site
Program.
Appcmd add Site/name: "My New Site"/id:2/bindings:http/*:81:/physicalpath: "C
: \inetpub\mynewsite "
Creates a new site, my new site, with the specified ID and bindings. The system will automatically create a root virtual directory pointing to the
The root application for the physical path.
Appcmd add Site/name: "My New site"/bindings:http/*:81:
Create a new site "My new site" with bindings and automatically generate the site ID. After it is created, the new site does not contain
Any application.
Configure a virtual site
APPCMD set SITE [identifier] [-Parameter 1: value 1 ...]
Allows you to set properties for the specified virtual site. You must provide an accurate site identifier, and you must resolve the identifier to an existing
There are sites.
Supported parameters:
Identifier (required)
Site name or URL of the site to be modified
/site.name
Site name or URL of the site to be modified (same as identifier)
/bindings
"Http://domain:port,..." friendly format or "Protocol/bindinginformation,..." original
Binding List of formats
Example:
Appcmd set Site "Default Web site"/serverautostart:false/id:100
Set the "ServerAutoStart" and "id" properties for the "Default Web site" site.
There are some advanced actions attached to the set operation (important)
At that time with Appcmd set site "Default Web site" At that time other advanced parameters
Explain the follow-up .....
-name Name
-id ID Identification
Whether the-serverautostart starts automatically
-bindings. [protocol= ' string ', bindinginformation= ' string '].P
-bindings. [protocol= ' string ', bindinginformation= ' string '].b
-limits.maxbandwidth
-limits.maxconnections
-limits.connectiontimeout
-logfile.logextfileflags
-logfile.customlogpluginclsid
-logfile.logformat
-logfile.directory
-logfile.period
-logfile.truncatesize
-logfile.localtimerollover
-logfile.enabled
-tracefailedrequestslogging.enabled
-tracefailedrequestslogging.directory
-tracefailedrequestslogging.maxlogfiles
-tracefailedrequestslogging.maxlogfilesizekb
-tracefailedrequestslogging.customactionsenabled
-applicationdefaults.path
-applicationdefaults.applicationpool
-applicationdefaults.enabledprotocols
-virtualdirectorydefaults.path
Physical path to the-virtualdirectorydefaults.physicalpath Web site
-virtualdirectorydefaults.username account for physical path credentials
-virtualdirectorydefaults.password the password for the physical path credential
-virtualdirectorydefaults.logonmethod
-virtualdirectorydefaults.allowsubdirconfig
-[path= ' String '].path
-[path= ' String '].applicationpool
-[path= ' String '].enabledprotocols
-[path= ' String '].virtualdirectorydefaults.path
-[path= ' String '].virtualdirectorydefaults.physicalpath
-[path= ' String '].virtualdirectorydefaults.username
-[path= ' String '].virtualdirectorydefaults.password
-[path= ' String '].virtualdirectorydefaults.logonmethod
-[path= ' String '].virtualdirectorydefaults.allowsubdirconfig
-[path= ' string ']. [path= ' String '].path
-[path= ' string ']. [path= ' String '].physicalpath
-[path= ' string ']. [path= ' String '].username
-[path= ' string ']. [path= ' String '].password
-[path= ' string ']. [path= ' String '].logonmethod
-[path= ' string ']. [path= ' String '].allowsubdirconfig
Delete a virtual site
APPCMD delete SITE [identifier] [-Parameter 1: value 1 ...]
Describe: Deletes the specified virtual site from the computer. You must provide an accurate site identifier, and the identifier must be resolved to an existing site.
Supported parameters:
Identifier (required) the site name or URL of the site to be deleted
/site.name the site name or URL of the site to be deleted (same as identifier)
Example:
Appcmd Delete Site "Default Web Site" deletes the Web "Default Web Site".
Start a virtual site
APPCMD start SITE [identifier] [-Parameter 1: value 1 ...]
Starts the specified virtual site and enables the site to start listening for new requests on all its binding endpoints. You must provide an accurate site identifier, and the identifier must be resolved to an existing site.
Supported parameters:
Identifier (required) the site name or URL of the site to start
/site.name the site name or URL of the site to start (same as identifier)
Example:
Appcmd start Site "Default Web site"
Start the site "Default Web site".
Stop a virtual site
APPCMD stop SITE [identifier] [-Parameter 1: value 1 ...]
Stops the specified virtual site and prevents new requests from being received on its bound endpoint. You must provide an accurate site identifier, and
The identifier must be resolved to an existing site.
Supported parameters:
Identifier (required) the site name or URL of the site to stop
/site.name site name or URL of the site to stop (same as identifier)
Example:
Appcmd stop Site "Default Web site"
Stop the site "Default Web site".
Key points:
APPcmd.exe is located in C:\Windows\System32\inetsrv, where the C drive is used as the system disk
Switch to this directory using Cd c:\Windows\System32\inetsrv
Appcmd start Site "Name of the website"
Appcmd the name of the stop site "website"
(Delete site "NewSite1")
Appcmd Delete Site "NewSite1"
(Create a new virtual site and bind the physical path to it)
Appcmd add Site/name: "NewSite1"/id:5/bindings:http/*:8002:/physicalpath: "e:\ source program __2013.2~3 Month \ieusewinformctrl"
Appcmd start Site "NewSite1"
IIS7.0 Appcmd Command Explanation