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

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)

The easiest way is to load up IIS Manager and click on the "Sites" folder. There should be a column called "ID" in the list shown in the Features View pane, and that's your Site ID.


You may also give a try to Powershell get-website commandlet. Without args it will list all sites together with IDs.

Tags:

Iis 7

Appcmd