Saturday, October 29, 2011

Appcmd.exe for IIS7


Appcmd.exe is a command line tool for managing IIS7.

Location:  %systemroot%\system32\inetsrv\

Here are the available commands:




















I needed to create some bindings for my Default Web Site. Here are the commands I used:

appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']
appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.pipe',bindingInformation='*']
appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost']


appcmd.exe set app "Default Web Site/evals" /enabledProtocols:http,net.pipe,net.tcp,net.msmq

When running these commands I got errors like this:






This means the binding already exists. If you want to remove the existing binding and replace it, here is the command to run:

appcmd.exe set site "Default Web Site" /-bindings.[protocol='net.tcp',bindingInformation='808:*'] 

and to add back:

appcmd.exe set site "Default Web Site" /+bindings.[protocol='net.tcp',bindingInformation='808:*']

You can also use AppcmdUI:
http://blogs.iis.net/ksingla/archive/2007/04/14/appcmdui-appcmd-command-autocompletion-tool.aspx

Other useful links:
http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/
http://forums.iis.net/t/1158284.aspx

No comments:

Post a Comment