Once a new web application is created within IIS, changing the settings can be accomplished through the IIS manager but some cannot. All settings can be changed by using the AppCmd.exe utility.
As an example, executing the following command would change the “Default Web Site” name to “Default_1”.
C:\Windows\System32\inetsrv>APPCMD set SITE “Default Web Site” /id:1 /name:Default_1
How it works:
- The APPCMD.exe is located in the %systemroot%\system32\inetsrv\ directory unless you have it as a path variable.
- The APPCMD command has various commands that it can execute on IIS objects.
- The “set” command will update object properties in IIS.
- The “Site” object is what will be updated. Note that it needs the name (IE web application name) of the object to change and the id parameter to know which web application to modify.
- Parameters are set using the /<ObjectProperty>:<ObjectValue> notation.
What its doing:
- Within IIS you’ll notice the object property being changed in the GUI.
- Under the hood it’s modifying the <site> attribute in the applicationHost.config file, which is used by the IIS GUI.
You can also inspect the applicationHost.config file for other object properties that can be set.