Function checkIUSR ()
Dim oThisServer, oWebsite , iCount, sQuery, oView
iCount = 0
' IIS internet guest account
On Error Resume Next
Set oThisServer = GetObject( "IIS://localhost/W3SVC" )
' Set default
Session.Property("IUSRCheck") = "BAD"
checkIUSR = ERROR_INSTALL_FAILURE
If( Err.Number <> 0 ) Then
MsgBox "Unable to retrieve IIS Websites - Please verify that the IIS is running! " & vbCrLf & _
"Error Details: " & Err.Description & " [Number:" & Hex(Err.Number) & "]", vbCritical, "Error"
GetWebSites = ERROR_INSTALL_FAILURE
Exit Function
Else
Session.Property("IUSRCheck") = "OK"
Session.Property("INTERNETGUESTACCOUNT") = oThisServer.AnonymousUserName
If Session.Property("INTERNETGUESTACCOUNT") = "IUSR" Then
Session.Property("INTERNETGUESTDOMAIN") = "NT AUTHORITY"
Else
Session.Property("INTERNETGUESTDOMAIN") = Session.Property("ComputerName")
End if
checkIUSR = ERROR_SUCCESS
End If
End Function
|