12

We have two IIS 8.5 web servers, Server 2012 R2

Server1

Server2

I am trying to find a powershell command that will sync only changes made on Server1 to Server2

I tried shared configurations however that will sync the bindings as well and I do not want that as they are load balanced. Also I am trying to avoiding adding unneeded bindings to servers to make it work.

I found a couple webdeploy powershell commands however that looks like it wants to sync files as well, we use DFS to sync the files.

All I want to be able to do is sync changes from the Server1 applicationhost.config or web.config to Server2

Anthony Fornito
  • 9,526
  • 1
  • 33
  • 122

1 Answers1

12

Got it (Make sure you are using CMD ADMIN and Powershell ADMIN)

Using CMD, it will not work in powershell not sure why it doesn't.

msdeploy -verb:sync -source:webserver,computerName=acd-pv01 -dest:webserver,computerName=acd-pv02 -skip:skipAction=Delete,objectName=binding -skip:skipAction=AddChild,objectName=binding

A little overview

There are a couple posts online about a custom rule replaceipbindings

However the type is not valid, this is a bug that has not been fixed yet.

So you have the add the -skip:skipAction to the command line to make it work and use the objectName=binding

1 problem is if you created a new site, the configuration is brought over however the binding info in not because you told it not to

So the fix that use powershell

Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/site[@name='SITENAME']/bindings" -name "." -value @{protocol='http';bindingInformation='IPADDRESS:80:SITENAME'}
Anthony Fornito
  • 9,526
  • 1
  • 33
  • 122