IIS 7 and Above
Re-IP All SNI Sites to new IP
Re: Re-IP All SNI Sites to new IP
Aug 15, 2019 10:33 PM|RBlackburn|LINK
As a follow up, I was able to successfully change all sites (170+) using a single SNI IP from one IP to a different IP in a single process. I have not found much online regarding changing an IP used across multiple sites (SNI) without a labor-intensive
process in the IIS Management Console. If anyone finds this useful, here goes.
The c:\Windows\System32\inetsrv\config\ApplicationHost.config contains all the sites and bindings in XML form and can be updated with a find/replace, finding the current IP and replacing with the new IP. You should make a copy of this file before making
any changes in case you need to roll back. We followed these steps:
1. Open Powershell as Admin
2. Stop IIS ... C:\>iisreset /stop
3. Open c:\Windows\System32\inetsrv\config\ApplicationHost.config in Notepad or Notepad++
4. Do a find/replace - old IP/new IP, then SAVE.
5. Restart IIS ... C:\>iisreset /start
6. Verify in IIS Management Console that your sites now show bound to the new IP ... xxx.xxx.xxx.xxx:443:siteURL
7. Do a reset of IIS (yes, a second time, not sure why, but was required before sites would work in every test we did) ... C:\>iisreset
When we completed these steps, including a second restart of IIS, all sites were now bound to the new IP and responding.
Last, just as an example, this is the portion of the config XML file being changed in the find/replace:
<site name="siteabc" id="160" serverAutoStart="true">
<application path="/" applicationPool=" siteabc">
<virtualDirectory path="/" physicalPath="H:\ siteabc" />
<binding protocol="https" bindingInformation="xxx.xxx.xxx.xxx:443:siteabc.somecompany.com" sslFlags="1" />