During last year, I configured few highly available IIS environments with few different settings. Regardless of whether it was configured with DFRS or shared disk, regardless of whether it was 2 or 12 servers, one thing is always the same. All websites must be configured identically. The easiest way to achieve this, is export and import application pools and web sites.

For exporting application pools on IIS, you can use command prompt and run command

%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\ExportAppPools.xml

This will export all the application pools on your webserver. Few application pools are same on all IIS server by default, because are they installed during IIS installation. For successfully import, you need to edit the ExportAppPools.xml and remove the application pools that you do not need to import.

For importing application pools on IIS, you can use command prompt and run command

%windir%\system32\inetsrv\appcmd add apppool /in < c:\ExportAppPools.xml

All the AppPools in the xml will be created on your second webserver.

 

For exporting all your web sites on IIS, you can use command prompt and run command

%windir%\system32\inetsrv\appcmd list site /config /xml > c:\ExportWebSites.xml

This will export all the websites on your webserver, You need to edit the ExportWebSites.xml and remove the websites that you do not need to import

For importing all web sites on IIS, you can use command prompt and run command

%windir%\system32\inetsrv\appcmd add site /in < c:\ExportWebSites.xml

 

If you want to export or import single application pool or web site, command is very similar. Just need application pool or web site name to command for exporting. Importing is same, because command read data from xml file.

%windir%\system32\inetsrv\appcmd list apppool "AppPoolName" /config /xml > c:\SingleAppPool.xml
%windir%\system32\inetsrv\appcmd list site "WebSiteName" /config /xml > c:\SingleWebSites.xml

Leave a Reply

Your email address will not be published. Required fields are marked *