How to find IIS7 SiteID using site name on Windows 2008 using appcmd or other util?

anil picture anil · Sep 5, 2012 · Viewed 24.3k times · Source

I am trying to find an IIS7 site ID using site name using appcmd or other utility but have not found any way to achieve it.

Answer

anil picture anil · Sep 6, 2012

The following command returns site ID:

%systemroot%\system32\inetsrv\APPCMD list site <SiteName>

Example output:

SITE "Default Web Site" (id:1,bindings:http/*:80:default.local,state:Started)
SITE "My Site" (id:2,bindings:http/*:80:my.local,state:Started)