tags:

views:

374

answers:

1

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

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

How do I reference a site using its IIS ID? I tried these variations:

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. )

+1  A: 

Doesn't look like it is supported. You can supply site name or URL but not 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. The exact site identifier must be provided and must resolve to an 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)
DmitryK
Yep...looks like ID isn't support. Going to hold out a bit longer though.
Kev