So I found the way to set the appSettings and connectionString in my web.config using appcmd.exe, but I tried every think I could to add an http Module to the <httpModules> section of the <system.web> with no success.
As it turns out in IIS 7 both <httpModules> and <httpHandlers> in <system.web> have been moved to <Modules> and <Handlers> in <system.webServer>. If you are using both the old location and the new location you will need to add the following item in the <system.webServer> section of the web.config file.
<system.webServer>
<validation validateIntegratedModeConfiguration=”false” />
</system.webServer> |
You can now use the following appcmd.exe commands:
Add Module (httpModule)
Set appcmd =C:\Windows\System32\inetsrv\appcmd.exe
Set SiteName=”Default Web Site”
%appcmd% set config %SiteName% /section:system.webServer\Modules /+”[name='<http Module Name>',type='<Module class and assembly information>']“ |
Remove Module (httpModule)
Set appcmd =C:\Windows\System32\inetsrv\appcmd.exe
Set SiteName=”Default Web Site”
%appcmd% set config %SiteName% /section:system.webServer\Modules /-”[name='<http Module Name>']“ |
Reference:
ASP.NET 2.0 Breaking Changes on IIS 7.0 at http://learn.iis.net/page.aspx/381/aspnet-20-breaking-changes-on-iis-70/
While SharePoint provides a place to configure alternate access mapping for each of the SharePoint site it does on update the bindings in the IIS configuration. In order to do this you can use appcmd.exe with the set site command.
With a large number of site binding to be configured for the different Site and server in SharePoint, for example if you have 4 web application on 4 server with 1 to 5 binding (average say 3) that would be 4 x 4 x 3 = 48 binding to be assigned to the SharePoint sites. By making use of 4 batch command files you can reduce the number of error accrues the server and there web application.
The following will add a new binding to the site
| Set appcmd =C:\Windows\System32\inetsrv\appcmd.exeSet SiteName=Default Web SiteSet IP=192.168.0.1:80Set FQDN=www.contos.com
%appcmd% set site “% SiteName%” /+bindings.[protocol='http',bindingInformation='%IP%:%FQDN%'] |
The following will remove an existing binding to the site
| Set appcmd =C:\Windows\System32\inetsrv\appcmd.exeSet SiteName=Default Web SiteSet IP=192.168.0.1:80Set FQDN=www.contos.com
%appcmd% set site “% SiteName%” /-bindings.[protocol='http',bindingInformation='%IP%:%FQDN%'] |
Using a combination of addition and removals you will be able to configure all the web application on all server the same.
References:
Binding <binding> on the IIS site.
Today Microsoft announced that the next SharePoint Conference will be in Anaheim, CA on October 3-6 2011.
Register to be notified and stay up to date on all conference announcements SPC 2011 site
Registration will open spring 2011.

Check out the early Early Bird Registration @ www.techdays.ca
Toronto dates are October 27th and 28th.