Classic ASP (VBScript), 2008 R2, error using AD to authenticate

旧街凉风 提交于 2019-12-08 13:40:18

问题


I have moved a web site from Win2003 x32 to Win2008R2 x64. It works fine on the old server. The web site uses active directory to authenticate. I get this error on 2008: -2147023584 : A specified logon session does not exist. It may already have been terminated. I have tried switching to classic mode, etc. with no change. It does execute VBScript code (otherwise I wouldn't get the error).

Here is the code:

Function AuthenticateUser(UserName, Password)

    On Error Resume Next

    Dim oADsNamespace, oADsObject
    Dim strADsNamespace, strADsPath

    strADsPath = "WinNT://ibcschools.edu"
    strADsNamespace = left(strADsPath, instr(strADsPath, ":"))

    Set oADsObject = GetObject(strADsPath)
    Set oADsNamespace = GetObject(strADsNamespace)
    Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, UserName, Password, 0)
    Response.Write(Err.Number & " : " & Err.Description & "<br />")
    If Err.Number = 0 Then

        Set oADsNamespace = Nothing
        Set oADsObject = Nothing
        Set strADsNamespace = Nothing
        Set strADsPath = Nothing

        AuthenticateUser = True

    Else

        Set oADsNamespace = Nothing
        Set oADsObject = Nothing
        Set strADsNamespace = Nothing
        Set strADsPath = Nothing

        AuthenticateUser = False

    End If

End Function

Any help would be appreciated. Thanks.


回答1:


Your problem seems to be related to using WinNT provider with OpenDSObject.

Things you could try:

  1. Replace WinNT with LDAP provider.
  2. Try running your standalone VBS file under IIS/ApplicationPool user privileges.



回答2:


Okay, so I got it working. Before it worked without the domain name, but now requires it. I think it has something to do with the app pool logging in on the old server versus this one. I am going to work on it a little more. I don't want to change all the sites.



来源:https://stackoverflow.com/questions/6818478/classic-asp-vbscript-2008-r2-error-using-ad-to-authenticate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!