tags:

views:

218

answers:

3

I'm trying to automate a sharepoint deployment and one of the tasks is to extend the web application using the stsadm command extendvsinwebfarm. However I'm constantly getting the error:

The IIS Web Site you have selected is in use by SharePoint. You must select ano ther port or hostname.

I think the problem is because I'm trying to extend web application using the same url. For example my cms site is:

http://myserver:8083

and i want my extended site to be:

http://myserver:80

Is it possible extend the web application using the same url via stsadm?

A: 

I think this is normally done by creating the extended site with whatever port SharePoint/stsadm demands, then changing the port to what you want in IIS.

strongopinions
+1  A: 

Yes, but the URL you pass into extendvsinwebfarm should have the port on it.

Using reflector it seems the Run method of the SPExtendVsInWebFarm class calls this: SPVirtualServer server = globalAdmin.ExtendVirtualServerInWebFarm(uri, virtualServerName, userTypedIn, appPoolId, bConfigurableAppPoolAccount, appPoolUserName, appPoolPassword, bAllowAnonymous, flag4);

The Uri that is passes has it's port extracted and that port is used to set up the web app.

Just tested this on our junk farm and so long as your url is in the form http://stuff:portnum then it all works.

chris.w.mclean
A: 

Ended up using some tools from: http://stsadm.blogspot.com/

Does exactly as i wanted and more....