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>