0

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.

vincentw56
  • 545
  • 8
  • 19

2 Answers2

0

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.
Filburt
  • 17,626
  • 12
  • 64
  • 115
  • I don't think that is it. That seems to be more if you are trying to access a UNC share or something. Anyway, I tried what it said and still doesn't work. I also saved these as a VBS file and it works fine. So it has something to do with IIS7. Just need to figure out what settings I need to use. – vincentw56 Jul 26 '11 at 01:45
  • I'd guess that your IIS/ApplicationPool user isn't allowed to perform this query - could it be that the web app on your old machine used a privileged user? – Filburt Jul 26 '11 at 07:07
  • No, it used Network Service. I tried switching it to many different users and also a domain user. Still no go. I will try your other suggestions. – vincentw56 Jul 26 '11 at 13:06
  • 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. – vincentw56 Jul 27 '11 at 15:45
  • Good to hear you were able to track it down. – Filburt Jul 28 '11 at 07:29
  • Hi - can you edit the code to the correct/working version please? I'm having the same issue – pee2pee Apr 16 '14 at 09:31
0

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.

vincentw56
  • 545
  • 8
  • 19
  • When I try to run the code above on my local machine, no matter what details I put in, it authenticates. Can I actually authenticate against my local machine using the above? – pee2pee Mar 10 '14 at 09:59