Creating an IIS website change deployment script

Often, I need to deploy an website change to a production server. It can be a simple change like creating a virtual directory and rather rarely very big like setting up a new site. We export iis website setting, delete everything but the change, and import the change using vbscript.  The command is like this.

Set IIsComputer = GetObject("winmgmts://localhost/root/MicrosoftIISv2:IIsComputer='LM'")
...
IIsComputer.Import "", strFilePath, strSourceMetabasePath, strDestinationMetabasePath, intFlags

The xml file only contains the part that changed and has a basic skeleton tags

<?xml version="1.0" ?>
<configuration xmlns="urn:microsoft-catalog:XML_Metabase_V64_0">
<MBProperty>
<IIS_Global	Location ="."
		SessionKey="......."
	>
</IIS_Global>
<IIsWebServer	Location ="/LM/W3SVC/00"></IIsWebServer>
<IIsWebDirectory	Location ="/LM/W3SVC/00/ROOT/jsk"
   ...
	>
</IIsWebDirectory>
</MBProperty>
</configuration>
Creating an IIS website change deployment script

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s