How can I change the IP address of all sites in IIS6 using powershell 1.0?

Question:

Using Powershell 1.0 under Windows Server 2003 with IIS 6.

I have about 200 sites that I would like to change the IP address for (as listed in the website properties on the “website” tab in the “Web site identification” section “IP address” field.

I found this code:

How can I do something like this but:

  1. Loop through all the sites in IIS
  2. Not insert a host header value, but change an existing one.

Answer:

The following PowerShell script should help:

Source:

How can I change the IP address of all sites in IIS6 using powershell 1.0? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply