Adding server (with port) to IIS web farm from command line

1.9k views Asked by At

I have a web farm setup correctly with 7 servers on it, I used IIS Webfarm GUI to add these server. Now I want to use the command prompt because I have to add more then 50 servers and don't want to do that task manually. Following is the command to that I have seen working from command prompt but unfortuantly I am not able to find attribute for httpPort number.

 appcmd.exe set config  -section:webFarms /+"[name='myServerFarm'].[address='127.0.0.1']" /commit:apphost

I have tried this command with "port", "httpPort" attributes with no avail.

Can anyone please show me the command to add a server with HTTP port. Thanks

2

There are 2 answers

0
adamclerk On BEST ANSWER

You should be able to do it with powershell and the Web Farm Framework cmdlets.

Web Farm Framework Cmdlets

Look for the heading "Adding a Server to a Server Farm Using the cmdlets"

0
Jeff Genega On

Here's an example that worked for me:

appcmd.exe set config -section:webFarms -[name='myServerFarm'].[address='127.0.0.1'].applicationRequestRouting.httpPort:8000