How do I reference a site by ID using IIS7 APPCMD?

I know how to refer to a site by name to stop it and start it? For example:

appcmd stop site /site.name:"Microsoft SharePoint Administration"

      

How do I link to a site using its IIS ID? I've tried these options:

appcmd start stop /site.id:2
appcmd start stop /site.id:"2"
appcmd start stop /site.id:2
appcmd start site /section:sites /[id='2']

      

However, they all return the following error:

ERROR ( message:Must specify the SITE object with identifier. )

+2


source to share


2 answers


It doesn't look like it is supported. You can provide a site name or URL, but not a site ID.

C: \ Windows \ System32 \ inetsrv> appcmd stop site /? Stop virtual site

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

Stops the specified virtual site and prevents new requests from being received on its binding endpoints. You must provide an exact site ID and must resolve the existing site.

Supported parameters:



identifier (required)

Site name or url of the site to stop

      

/site.name

Site name or url of the site to stop (same as identifier)

      

+2


source


Work for me, but this is not ideal:

Id website = 169



%systemroot%\system32\inetsrv\APPCMD list sites /xml | find "169"

      

+1


source







All Articles