Skip to Main Content
Windows Server 2008: The Definitive Guide
book

Windows Server 2008: The Definitive Guide

by Jonathan Hassell
March 2008
Beginner to intermediate content levelBeginner to intermediate
494 pages
13h 4m
English
O'Reilly Media, Inc.
Content preview from Windows Server 2008: The Definitive Guide

Managing IIS from the Command Line

In this section, we'll take a look at administering IIS 7 outside of IIS Manager. We'll start by examining some common administrative scenarios through the user of AppCmd.exe, and then look at the text-file configuration options that this new version of IIS presents to us.

AppCmd.exe: One-Stop Configuration

IIS 7 includes AppCmd.exe, which is a new, one-stop executable for administering essentially every function IIS provides. Through AppCmd, you can create and configure sites, application pools, and virtual directories; start, stop, and recycle sites and pools; examine current activities in the core of the web server service; and generally find, copy, and import configurations of both IIS itself and the ASP.NET subcomponent.

AppCmd takes a logical syntax: you perform an operation, or command, on a specific piece of IIS, or an object. For example, you can list sites (list being the command and site being the object), add applications, delete worker processes, or set configurations.

Tip

You can get a general sense of the scope of functions AppCmd supports by using the /? switch at a command line.

For example, we can list the sites that are stopped on a server by using the following command:

appcmd list sites /state:Stopped

We can add a completely new web site entirely from the command line. Let's add a site named "Booksite" that listens on port 81 and whose content is stored at c:\inetpub\wwwroot\booksite:

appcmd add site /name:BookSite /id:2 /bindings:"http/*:81:" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Complete Guide to Windows Server 2008

The Complete Guide to Windows Server 2008

John Savill

Publisher Resources

ISBN: 9780596514112Errata Page