Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2008 : Manipulating IIS with appcmd

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/5/2012 4:10:39 PM

You can use the appcmd tool to manage IIS websites. This might be useful if you’re running IIS on a Server Core installation.

Tip

You can also manage Microsoft Management Consoles, including the Internet Information Services (IIS) Manager,shows how to configure a Server Core installation for remote management. Because many of the commands are not repeated, it’s often easier to use the GUI instead of the appcmd tool.


The appcmd tool is located in the c:\windows\system32\inetsrv folder. Because this path isn’t included in the path, you have to include it in commands. For example, to get help for the appcmd, you can use the following command:

C:\>c:\windows\system32\inetsrv\appcmd /?

The basic syntax of the appcmd is

appcmd command object

Most objects accept one of the following four commands: list, add,set, and delete. Some objects can also be stopped and started with the stop and start commands. The following table shows the different objects, and the basic syntax used with the list command.

Note

You can get additional help on any of these topics by combining one of the four commands with one of the objects in the format of appcmd command object /?.


Using the list Command for Each of the ObjectsComments
Sites
C:\>c:\windows\system32\inetsrv\appcmd list
site

Administration of virtual sites
Applications
C:\>c:\windows\system32\inetsrv\appcmd list
app

Administration of applications
Virtual directories
C:\>c:\windows\system32\inetsrv\appcmd list
vdir

Administration of virtual directories
apppool
C:\>c:\windows\system32\inetsrv\appcmd list
apppool

Administration of application pools
config
C:\>c:\windows\system32\inetsrv\appcmd list
config

Administration of general configuration sections
backup
C:\>c:\windows\system32\inetsrv\appcmd list
backup

Management of server configuration backups
wp
C:\>c:\windows\system32\inetsrv\appcmd list wp

Administration of worker processes
request
C:\>c:\windows\system32\inetsrv\appcmd list
request

Display of active HTTP requests
module
C:\>c:\windows\system32\inetsrv\appcmd list
module

Administration of server modules
trace
C:\>c:\windows\system32\inetsrv\appcmd list
trace

Management of server trace logs

Adding a Site with appcmd

You can also add a site with the appcmd tool.

Adding a Site with appcmdComments
Add a site.
appcmd add site /name:site-name
/bindings:http/port:[host-header]
C:\>c:\windows\system32\inetsrv\
appcmd add site /name:"Success"
/bindings:http/8080
C:\>c:\windows\system32\inetsrv
\appcmd add site /name:"Success2"
/bindings:http/80:success2

The add site command adds a website. You only need to identify the site name, the port, and a host header if one is used. The first example creates a site named Success on port 8080. The second example adds a site named Success2 on port 80 with a host header of success2.

Adding an Application to a Site with add app

Adding an Application with add appComments
Add an application to a site.
appcmd add app /site.name:site-name
/path:/app-name
C:\>c:\windows\system32\inetsrv\appcmd
add app /site.name:"success" /path:/app

You can add applications to existing websites with the add app command. The example creates an application named app for the site named success.

Adding a Virtual Directory with add vdir

Adding a Virtual Directory with add vdirComments
Add a virtual directory to a site.
appcmd add vdir /app.name:"web-
site/app-name" /path:/Web-site-virtual-
path/physicalpath:actual-path
C:\>c:\windows\system32\inetsrv\appcmd
add vdir /app.name:"default web site
/app1" /path:/svdir /physicalpath:g:
/svdir

You can add virtual directories to existing websites with the add vdir command.

The example adds a virtual directory named svdir to the app1 application in a website named default web site. The actual path to the directory is identified in the /physicalpath switch as g:/svdir.

Figure 1 shows the result of this command. The virtual directory (named svdir) is added within the Default Web Site. The Advanced Settings of the virtual directory show the physical path is on g:\svdir (instead of in the same path as the Default Web Site).

Figure 1. Viewing the virtual directory created from appcmd


Starting and Stopping Application Pools with appcmd and appcmd stop

You can start and stop application pools with the appcmd start and appcmd stop commands. The basic syntax is

appcmd start apppool application-name
appcmd stop apppool application-name

For example, if the application pool is named successpool, you can stop and start it with the following commands:

appcmd start apppool successpool
appcmd stop apppool successpool
Other -----------------
- Microsoft Lync Server 2010 Edge : Edge Server Administration (part 2)
- Microsoft Lync Server 2010 Edge : Edge Server Administration (part 1)
- Sharepoint 2010 : Setting Up the Crawler - Crawling Other Document Types with iFilters
- Sharepoint 2010 : Setting Up the Crawler - Defining Scopes
- Microsoft Dynamics CRM 4.0 Accelerators : Extended Sales Forecasting Accelerator (part 1) - CRM Reports
- Microsoft Dynamics CRM 4.0 Accelerators : Extended Sales Forecasting Accelerator (part 1) - CRM Customizations
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Building a Display dimensions dialog
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Creating electronic payment format
- Sharepoint 2007 : Change the Look of a Site Using Themes & Change the Home Page of a Site
- Sharepoint 2007 : Open the Site’s Settings Page & Change the Name, Description, Icon, or URL of a Site
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server