tags:

views:

1105

answers:

2

My programming environment includes scripts for setting up my autobuild on a clean machine.

One step uses a vbscript to configure a website on IIS that is used to monitor the build.

On a particular machine I will be running apache on port 80 for a separate task.

I would like my vbscript to set the port to 8080 for the new site that it is adding.

How can I do this?

+2  A: 
Ady
IIS will assign an ID to the site when it is created (depending on version either random, or based on it's name). It's the same number used for the log file directory.
Ady
Thanks this was helpful - i think the example has a few +1 errors but gave me the general idea
morechilli
could you point them out, and I'll clean up the answer (for others if they reference).
Ady
Ok i got it to work with the following changes: [line6]Set objWebApp = GetObject("IIS://localhost/w3svc/1") [line12] Redim arrNewBindings(intArraySize) [line18] arrNewBindings(intArraySize) = ":mydomain.com:8080:" - I don't know vbscript so i might be misunderstanding
morechilli
+2  A: 

You can use adsutil.vbs, part of the IIS admin scripts, to change that:

cscript adsutil.vbs set W3SVC/1/ServerBindings “:8080:”

In a default layout, the script resides in C:\Inetpub\AdminScripts\.

Tomalak
Thanks this works nicely
morechilli