Using Powershell 1.0 under Windows Server 2003 with IIS 6.
I have about 200 sites to which I would like to change the IP address (as indicated in the website properties on the "Website" tab in the "Website Identification" section "IP Address".
I found this code:
$site = [adsi]"IIS://localhost/w3svc/$siteid" $site.ServerBindings.Insert($site.ServerBindings.Count, ":80:$hostheader") $site.SetInfo()
How can I do something like this, but:
- Scrolling through all sites in IIS
- Do not enter a host header value, but modify an existing one.
source share