Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that using IIS Manager, I can save the configuration for an IIS site to a file, go to a new machine and then create a new web site from that (XML) file.

My question is: How can I automate the creation a website using a saved configuration (xml) file?

Bonus points for answers that let me do this with IIS 6.0

share|improve this question
up vote 2 down vote accepted

You can synch (and thus effectively transfer) sites between servers using the Web Deployment Tool. Specifically, there is a quide to doing this in IIS 6.0.

share|improve this answer

If you want to stay away from writing your own serialization and deserialization mechanism for the metabase data, you can use the code that Microsoft uses in the Export/Import XML functionality in the IIS console. Yo' re going to have to write code to interface with it, but the API is there to do what you want starting in IIS 6.

Have a look at the IMSAdminBase2 object, and specifically the IMSAdminBase2::Export and IMSAdminBase2::Import methods.

You could use ADSI to accomplish what you're looking for, but then you're talking about enumerating the metabase, serializing the data yourself into your own proprietary XML schema, then deserializing it and importing it into the metabase on the destination server yourself. I'd avoid that, personally.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.