Configure Server-Level Settings by Using Appcmd.exe (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

In IISĀ 7, you can configure settings in server-level configuration files or in Web.config files that are in a folder for a site, application, or virtual directory. Server-level configuration files are Machine.config, the root Web.config file, and ApplicationHost.config. These three files are available only to the Administrator account or to users who are members of the Administrators group on the Web server. In addition, members of the Administrators group must open a command-shell window that uses their elevated administrator permissions to read and change settings in the server-level configuration files. For more information about starting Appcmd.exe in a command-shell window that uses elevated administrator permissions, see Start Appcmd.exe (IIS 7).

By default, ApplicationHost.config is the file from which Appcmd.exe reads configuration and to which Appcmd.exe writes changes. When you want to read changes from or write changes to Machine.config or the root Web.config file, you must include a commit parameter in your command. Specify MACHINE for the commit parameter when you want to affect the Machine.config file or specify WEBROOT when you want to affect the root Web.config file.

For example, to list the machineKey section in the root Web.config file, type the following command at the command prompt, and then press ENTER:

appcmd list config /section:machineKey /commit:WEBROOT

See Also


Appcmd.exe (IIS 7)