Using appcmd to add a new site without providing a site id?

I am writing a script package for deploying websites packaged in Visual Studio 2010. In the script, I am adding new sites as such:

appcmd add site /name:MySite /id:123

However, I do not want to provide a site identifier. I would just like appcmd randomly assign it to me. But the id parameter is required for appcmd , so how do I get around it?

+7
source share
2 answers

I never knew the / id switch was required - I always used the form:

 appcmd add site /name:"%appName%" /bindings:http://%appDns%:80 /physicalPath:"%mainApplicationPath%" 

And there was never any problem. What error does appcmd give you when you don't specify it?

+10
source

Use the appcmd command, enter

 %systemroot%\system32\inetsrv\APPCMD add site /? 

And you will see that only the name parameter is required, here is part of this output:

[w: \ kanta]% systemroot% \ system32 \ inetsrv \ APPCMD add site /? Add new virtual site

APPCMD add SITE <-parameter1: value1 ...>

Creates a new virtual site with the specified settings. At a minimum, you must provide the name and identifier of the site.

Supported options:

/ name (required)

 Site name 

/identifier

 Site id 

/ bindings

 List of bindings in the friendly form of "http://domain:port,..." or raw form of "protocol/bindingInformation,..." 

/ physicalPath

 If specified, will cause the root application containing a root virtual directory pointing to the specified path to be created for this site. If omitted, the site is created without a root application and will not be startable until one is created. 

/?

 Display the dynamic site properties that can be set on the new site 
+1
source

All Articles