Trick:
Save and Restore IIS Configuration

 

Create IISConfigSave.bat file with Notepad to save IIS Configuration to IISConfig.xml file:

 

@echo off
rem ---------------------------------------------------------------------------------------------------
rem Run this file to save IIS configuration.
rem ---------------------------------------------------------------------------------------------------

rem Create Backup file for old configuration.

rem ---------------------------------------------------------------------------------------------------

del IISConfig.xml.bak
copy IISConfig.xml IISConfig.xml.bak
del IISConfig.xml
rem ---------------------------------------------------------------------------------------------------

rem Run IIsCnfg.vbs to save IIS Configuration.

rem ---------------------------------------------------------------------------------------------------

%windir%\system32\IIsCnfg.vbs /export /f IISConfig.xml /sp /lm/w3svc /children /inherited

 

Create IISConfigRestore.bat file with Notepad to restore IIS Configuration from IISConfig.xml file:

 

@echo off
rem ---------------------------------------------------------------------------------------------------
rem Run this file to restore IIS configuration.
rem ---------------------------------------------------------------------------------------------------
rem Run IIsCnfg.vbs to restore IIS Configuration.

rem ---------------------------------------------------------------------------------------------------

%windir%\system32\IIsCnfg.vbs /import /f IISConfig.xml /sp /lm/w3svc /dp /lm/w3svc /children /inherited

 

Now you can simply to run them from Windows Explorer to save and restore IIS configuration.

 


 

You can to save and restore individual configurations of web domains.

Each web have unique IDentifier  number:

 

 

You can get this number also from metabase path (W3SVC/<IDentifier>) by using "iisweb.vbs" script:
iisweb.vbs /query "mydomain.com"

 

 

 

For example: If you want to save mydomain.com (ID: 2003831717) web configuration to file then run this from command line:

 

C:\> %windir%\system32\IIsCnfg.vbs /export /f mydomain.com.config.xml /sp /lm/w3svc/2003831717 /children /inherited

 

Now you can to delete mydomain.com web and later to restore with this command:

 

C:> %windir%\system32\IIsCnfg.vbs /import /f mydomain.com.config.xml /sp /lm/w3svc/2003831717 /dp /lm/w3svc/2003831717 /children /inherited

 

 

 

 

P.S.: More Information: http://www.microsoft.com/windowsxp/home/using/productdoc/en/iiscnfg.asp