[IIS6]

For IIS6 my recommendation is to use the IISCNFG.VBS script to export IIS configuration for your application once configured correctly on one server and then use the same script to import the configuration onto other servers in the farm.  In fact, IISCNFG.vbs can be used to export the entire configuration for your server and allow you to restore (using /import) onto another IIS6 server, stripping the machine-specific encryption out of the metabase and instead encrypting with a password that you supply.  A few words of caution though, as this isn’t bullet-proof:

1.  Not all “machine-specific” data is stripped.  If you’re creating local accounts (for say the anonymous user or appPool ID’s), you’ll need to have those accounts created on the other systems too.  Another thing to be wary of is server certificates. 

a.  NET SUMMARY : this will work for most things, but you might need to go back in and make some minor changes after /IMPORT’ing the configuration onto a different server

2.  You can use this for any path in the metabase too.  If you just want to export the IIS configuration settings into an XML file once you get the app configured correctly, then keep that configuration in source control with the rest of your ASP.net settings (like web.config) & content, that would work too.  Then deployment is a 3step action:

a.  Xcopy app over to new server

b.  Iiscnfg.vbs /import myAppConfig.xml

c.  Del myAppConfig.xml (b/c you don’t want this hanging out in your content dir J).

One of our MVP’s (Scott Forsyth) wrote a pretty good discussion on this http://weblogs.asp.net/owscott/archive/2006/06/07/IISCnfg.vbs---IIS-Settings-Replication.aspx

 
[IIS7 Deployment]

In IIS7 we’re doing quite a bit to really address centralized content and configuration.  With Longhorn Server Beta 3 coming out “soon”, you’ll see new capabilities that will allow all the front end web servers to share the same master configuration file (now applicationHost.config) which resides on a UNC share.  And now that IIS & ASP.net configuration is merged in IIS7 and can be stored in web.config files (i.e. <system.webServer> for IIS, <system.web> for ASP.net), all application configuration can truly live with the application.

 We’ve written a walkthrough on how to setup centralized content and configuration (one for a hosting scenario, one for centralized applicationHost.config) which will be published to IIS.net when Server Beta 3 releases. 

 I’d highly recommend you check out http://iis.net (click on the IIS7 nav) to get a head start on all the changes in IIS7 for configuration if you haven’t already done so.

Reference: Eric Deily [Eric.Deily@microsoft.com]