While using multiple IIS servers in a Load Balanced Environment, it will be a lot of work to create all your website twice with the same settings on each webserver.  In this scenario, it will create more critical to create a large number of binding for each server, so there is possible to export and import your configuration from one webserver to the other by using the command.

Executed and Tested Version

OS : Windows 10
IIS : 10.0.15063.0

To Export the website/IIS Bindings:

Macking backup of IIS configuration is as simple as copying the directory into a backup directory, so you don’t need anything special to do it.  Just execute the below command in the Command prompt to make the backup copy in “C” drive with the file name Import_ProdBindings.xml

%windir%\system32\inetsrv\appcmd list site /config /xml > C:\Import_ProdBindings.xml

To Import the website/IIS Bindings:

As like Backup, it very simple to add the config to the IIS by using below command.

%windir%\system32\inetsrv\appcmd add site /in < C:\Import_ProdBindings.xml

OUTPUT:

Error :

I had faced the below error while exporting the config to the IIS. This error is due to the presence of “Default Web Site” in the targeted IIS.  So you can delete the existing one before executing the new config OR you can change the name of “Default Web Site” in the config and start the import from backup.

Pretty easy, eh?  Except for the dirty little secret everyone knows…remembering to do a backup before starting the Import! 

“ERROR ( message:Failed to add duplicate collection element “Default Web Site”. )”