Search code examples
iis-7appcmd

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


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.


Solution

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