Use System.DirectoryServices from classic asp

Discussion in 'ASP .Net Security' started by jrsrls@hotmail.com, Mar 13, 2006.

  1. Guest

    I need to authenticate against AD from a classic asp site. I've
    created a C# project that runs as an exe and successfully authenticates
    using DirectorySerivces with the entered credentials. When I add the
    code to a class (.dll) and register the object with regasm and gacutil
    the asp page successfully calls the object but I cannot bind to AD.

    I get the following message. "The specified domain either does not
    exist or could not be contacted"

    I think it is because of the permissions the object is running under
    but I do not know how to get around it. I can't change the settings on
    the web server which is set to anonymous access.

    Any thoughts or suggestions?
    , Mar 13, 2006
    #1
    1. Advertising

  2. This is probably because the identity that is running the code is not a
    domain account and your code is using serverless binding (no server or
    domain info in the binding string; just a DN).

    You might try adding the DNS domain name of the domain to your ADsPath:
    LDAP://yourdomain.com/RootDSE

    instead of LDAP://RootDSE

    Note that ASP has ADSI and the OpenDsObject method. You could have just
    called that instead of going through the trouble of doing a COM callable
    wrapper. S.DS just calls ADSI anyway!

    Joe K.

    <> wrote in message
    news:...
    >I need to authenticate against AD from a classic asp site. I've
    > created a C# project that runs as an exe and successfully authenticates
    > using DirectorySerivces with the entered credentials. When I add the
    > code to a class (.dll) and register the object with regasm and gacutil
    > the asp page successfully calls the object but I cannot bind to AD.
    >
    > I get the following message. "The specified domain either does not
    > exist or could not be contacted"
    >
    > I think it is because of the permissions the object is running under
    > but I do not know how to get around it. I can't change the settings on
    > the web server which is set to anonymous access.
    >
    > Any thoughts or suggestions?
    >
    Joe Kaplan \(MVP - ADSI\), Mar 13, 2006
    #2
    1. Advertising

  3. Guest

    Joe,

    Thanks for the response. That was the problem. I added the DNS and all
    is well.
    , Mar 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward
    Replies:
    1
    Views:
    2,403
    Edward
    Jul 8, 2003
  2. David M. Weprin

    System.DirectoryServices

    David M. Weprin, Oct 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    373
    Yovi Oktofianus
    Oct 18, 2003
  3. Scott G.

    Re: System.DirectoryServices

    Scott G., May 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    374
    Scott G.
    May 1, 2004
  4. jm
    Replies:
    0
    Views:
    354
  5. =?Utf-8?B?Q2hyaXMgRnJvaGxpY2g=?=

    System.DirectoryServices COM Exception 0x80072020

    =?Utf-8?B?Q2hyaXMgRnJvaGxpY2g=?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,429
    =?Utf-8?B?Q2hyaXMgRnJvaGxpY2g=?=
    Oct 21, 2004
Loading...

Share This Page