Displaying the Web Site ID and the Description for Kerberos

This script will show you the W3SVC Web Site ID and the description.

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 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:

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
Set IISOBj=Nothing
WScript.Echo ""
End function

Call ShowSites("w3svc", "IIsWebServer", "Web")

The output from this is similar to the following:

Web Sites                    Description
W3SVC/1                   Default Web Site
W3SVC/1036328378 WebSite1
W3SVC/1816184000 WebSite2
W3SVC/1867813904 WebSite3
W3SVC/568530179   WebSite4
W3SVC/719499532   WebSite5
W3SVC/669732006   WebSite6

Check if Kerberos is configured for your web application

Start a Command Prompt.

cd c:\inetpub\adminscripts
cscript adsutil.vbs get w3svc/<id of your website>/root/NTAuthenticationProviders

(you will find the I.D of your website through IIS Management under identifier)

For Kerberos the result is: NTAuthenticationProviders : (STRING) "Negotiate,NTLM"
For NTLM the result is: NTAuthenticationProviders : (STRING) “NTLM"

Configuring the IIS website with another method (in this example to Kerberos) use the following command:

cd c:\inetpub\adminscripts
cscript adsutil.vbs set w3svc/<id of your website>/root/NTAuthenticationProviders “Negotiate,NTLM”

This is needed on every SharePoint web frontend server.


Permalink | Comments (0) | Post RSSRSS comment feed