IIS log files are stored by default in the %SystemDrive%\inetpub\logs\LogFiles folder of your IIS server. The folder is configured in the Directory property on the Logging page for either the server or an individual site.
If you go into Internet Manager you can see the Site ID's by clicking on the Sites node in the navigation pane. So, if a site has ID 1 its log folder name is W3SVC1, ID2 = W3SVC2, etc. You could also review %WinDir%\System32\Inetsrv\Config\applicationHost. Config , which contains information about all of the sites.
Hold down the Windows key, press the letter X, and then click Control Panel. Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
Ok, I've found this property - it's called "site id" and resides in "Advanced Properties" of the website.
'Open IIS manager, click on the top level websites folder, view the lists of sites in the right hand pane, listing the App ID's.'
thanks to Sam on Server Fault
We can also get it using command line :
C:\>%windir%\system32\inetsrv\appcmd list site
The output would be like below:
SITE "Default Web Site" (id:1,bindings:HTTP/*:80:,state:Started)
SITE "Site1" (id:2,bindings:http/*:81:,state:Started)
The id field corresponds to the id found in log files. inetpub\logs\LogFiles (W3SVC1, W3SVC2
You can find from website properties of IIS manager. With IIS 6 the Web Site ID is a randomly generated number for each site that is created other than the Default Web Site which has an Web Site ID of 1.
For example:
Knowing which web site these being to is a problem as it requires you to manually look at each web site. The following VB script will allow you to output the ID and name.
Save the script to a file with a .VBS file extension and then run using this command (for IIS 6).
cscript MyFile.VBS
Function ProcessWebSite(ServiceType, SiteNumber)
Set IISWebSite = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber)
Set IISWebSiteRoot = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber & "/root")
ProcessWebSite = IISWebSite.ServerComment
Set IISWebSiteRoot = nothing
Set IISWebSite = Nothing
end function
Function ShowSites(ServiceType, ClassName, Title)
Wscript.echo "Web Sites Description"
Wscript.echo "==============================================================="
Set IISOBJ = getObject("IIS://localhost/" & ServiceType)
for each Web in IISOBJ
if (Web.Class = ClassName) then
wscript.echo Ucase(ServiceType) & "/" & Web.Name & _
Space(17-(len(Ucase(ServiceType))+1+len(Web.Name))) & " " & _
ProcessWebSite(ServiceType, Web.name)
end if
next
Set IISOBj=Nothing
WScript.Echo ""
End function
Call ShowSites("w3svc", "IIsWebServer", "Web")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With