Professional Web Applications Themes

LDAP and ASP - Problem - ASP Database

Hi, i have a (little) Problem with connecting to the LDAP Server. I need to get a list of all Users and there LoginNames in the companie's activedirectory. The following code works in an normal vbs script: Set oContainer=GetObject("LDAP://OU=sar- dgf,DC=sar,DC=intern") But when I use this code in an asp page on the sam comptuer, i get an internal server error. So i have tried this code: Set X = GetObject("LDAP://mail/dc=sar,dc=intern") for each Member in X response.write(Member.Name & "<br>") next With this code i at least get back something, which is 'CN=System' and 'CN=BuiltIn', but i do not get any userlist ...

  1. #1

    Default LDAP and ASP - Problem

    Hi,

    i have a (little) Problem with connecting to the LDAP
    Server.

    I need to get a list of all Users and there LoginNames in
    the companie's activedirectory.

    The following code works in an normal vbs script:
    Set oContainer=GetObject("LDAP://OU=sar-
    dgf,DC=sar,DC=intern")

    But when I use this code in an asp page on the sam
    comptuer, i get an internal server error.

    So i have tried this code:
    Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    for each Member in X
    response.write(Member.Name & "<br>")
    next

    With this code i at least get back something, which
    is 'CN=System' and 'CN=BuiltIn', but i do not get any
    userlist or grouplist at all.

    Does anyone know how to solve this problem? As i said the
    script with the command above works, but not the asp page
    with the same command on the sam computer.

    Google dindn't help me at all, so i hope that anyone of
    you ever had that problem and also solved it.

    Thxx

    Treml Juergen Guest

  2. #2

    Default Re: LDAP and ASP - Problem

    I'm guessing that it's because you need to use Server.CreateObject() instead
    of GetObject() for your ASP script...


    "Treml Juergen" <juergentremlsar-gmbh.com> wrote in message
    news:13fc01c381e0$3a785d50$a301280aphx.gbl...
    > Hi,
    >
    > i have a (little) Problem with connecting to the LDAP
    > Server.
    >
    > I need to get a list of all Users and there LoginNames in
    > the companie's activedirectory.
    >
    > The following code works in an normal vbs script:
    > Set oContainer=GetObject("LDAP://OU=sar-
    > dgf,DC=sar,DC=intern")
    >
    > But when I use this code in an asp page on the sam
    > comptuer, i get an internal server error.
    >
    > So i have tried this code:
    > Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    > for each Member in X
    > response.write(Member.Name & "<br>")
    > next
    >
    > With this code i at least get back something, which
    > is 'CN=System' and 'CN=BuiltIn', but i do not get any
    > userlist or grouplist at all.
    >
    > Does anyone know how to solve this problem? As i said the
    > script with the command above works, but not the asp page
    > with the same command on the sam computer.
    >
    > Google dindn't help me at all, so i hope that anyone of
    > you ever had that problem and also solved it.
    >
    > Thxx
    >

    Boris Nikolaevich Guest

  3. #3

    Default Re: LDAP and ASP - Problem

    Thxx for your answer. I tried what you said, but i
    doesn't, as i expected, not work.

    This isn't a object i want to be created by the server. It
    is an object that already exists, which i want to get
    information from, though not Create but Get.


    >-----Original Message-----
    >I'm guessing that it's because you need to use
    Server.CreateObject() instead
    >of GetObject() for your ASP script...
    >
    >
    >"Treml Juergen" <juergentremlsar-gmbh.com> wrote in
    message
    >news:13fc01c381e0$3a785d50$a301280aphx.gbl...
    >> Hi,
    >>
    >> i have a (little) Problem with connecting to the LDAP
    >> Server.
    >>
    >> I need to get a list of all Users and there LoginNames
    in
    >> the companie's activedirectory.
    >>
    >> The following code works in an normal vbs script:
    >> Set oContainer=GetObject("LDAP://OU=sar-
    >> dgf,DC=sar,DC=intern")
    >>
    >> But when I use this code in an asp page on the sam
    >> comptuer, i get an internal server error.
    >>
    >> So i have tried this code:
    >> Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    >> for each Member in X
    >> response.write(Member.Name & "<br>")
    >> next
    >>
    >> With this code i at least get back something, which
    >> is 'CN=System' and 'CN=BuiltIn', but i do not get any
    >> userlist or grouplist at all.
    >>
    >> Does anyone know how to solve this problem? As i said
    the
    >> script with the command above works, but not the asp
    page
    >> with the same command on the sam computer.
    >>
    >> Google dindn't help me at all, so i hope that anyone of
    >> you ever had that problem and also solved it.
    >>
    >> Thxx
    >>
    >
    >
    >.
    >
    Treml Juergen Guest

  4. #4

    Default Re: LDAP and ASP - Problem

    ok, i found the problem myself now, but this leads me to
    another one:

    the problem was: IIS authenticates towards ActiveDirectory
    as anonynous which has not the rights to read AD entries.

    but allowing anonymous user to do so is not really a
    solution. a better one would be, to make IIS authenticate
    towards AD as a certain user (e.g. Admin).

    does anyone know how to do this?

    thxx

    >-----Original Message-----
    >I'm guessing that it's because you need to use
    Server.CreateObject() instead
    >of GetObject() for your ASP script...
    >
    >
    >"Treml Juergen" <juergentremlsar-gmbh.com> wrote in
    message
    >news:13fc01c381e0$3a785d50$a301280aphx.gbl...
    >> Hi,
    >>
    >> i have a (little) Problem with connecting to the LDAP
    >> Server.
    >>
    >> I need to get a list of all Users and there LoginNames
    in
    >> the companie's activedirectory.
    >>
    >> The following code works in an normal vbs script:
    >> Set oContainer=GetObject("LDAP://OU=sar-
    >> dgf,DC=sar,DC=intern")
    >>
    >> But when I use this code in an asp page on the sam
    >> comptuer, i get an internal server error.
    >>
    >> So i have tried this code:
    >> Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    >> for each Member in X
    >> response.write(Member.Name & "<br>")
    >> next
    >>
    >> With this code i at least get back something, which
    >> is 'CN=System' and 'CN=BuiltIn', but i do not get any
    >> userlist or grouplist at all.
    >>
    >> Does anyone know how to solve this problem? As i said
    the
    >> script with the command above works, but not the asp
    page
    >> with the same command on the sam computer.
    >>
    >> Google dindn't help me at all, so i hope that anyone of
    >> you ever had that problem and also solved it.
    >>
    >> Thxx
    >>
    >
    >
    >.
    >
    Treml Juergen Guest

  5. #5

    Default Re: LDAP and ASP - Problem

    Don't you have this same thread going on in asp.db?

    Ray at work

    "Treml Juergen" <juergentremlsar-gmbh.com> wrote in message
    news:028301c381ef$7f82c7f0$a301280aphx.gbl...
    > ok, i found the solution to the problem on my own a few
    > minutes ago, but this led me to another one:
    >
    > the problem was: IIS authenticates towards ActiveDirectory
    > as anonynous which has not the rights to read AD entries.
    >
    > but allowing anonymous user to do so is not really a
    > solution. a better one would be, to make IIS authenticate
    > towards AD as a certain user (e.g. Admin).
    >
    > does anyone know how to do this?
    >
    > thxx
    >
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >i have a (little) Problem with connecting to the LDAP
    > >Server.
    > >
    > >I need to get a list of all Users and there LoginNames in
    > >the companie's activedirectory.
    > >
    > >The following code works in an normal vbs script:
    > >Set oContainer=GetObject("LDAP://OU=sar-
    > >dgf,DC=sar,DC=intern")
    > >
    > >But when I use this code in an asp page on the sam
    > >comptuer, i get an internal server error.
    > >
    > >So i have tried this code:
    > >Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    > >for each Member in X
    > > response.write(Member.Name & "<br>")
    > >next
    > >
    > >With this code i at least get back something, which
    > >is 'CN=System' and 'CN=BuiltIn', but i do not get any
    > >userlist or grouplist at all.
    > >
    > >Does anyone know how to solve this problem? As i said the
    > >script with the command above works, but not the asp page
    > >with the same command on the sam computer.
    > >
    > >Google dindn't help me at all, so i hope that anyone of
    > >you ever had that problem and also solved it.
    > >
    > >Thxx
    > >
    > >.
    > >

    Ray at Guest

  6. #6

    Default Re: LDAP and ASP - Problem

    In IIS administrator, right click your application and select properties, on
    the directory security tab click the "edit" button next to Anonymous Access.
    Enter the username and password of the account you'd like IIS to run under


    "Treml Juergen" <juergentremlsar-gmbh.com> wrote in message
    news:025501c381ef$39fa2ed0$a301280aphx.gbl...
    > ok, i found the problem myself now, but this leads me to
    > another one:
    >
    > the problem was: IIS authenticates towards ActiveDirectory
    > as anonynous which has not the rights to read AD entries.
    >
    > but allowing anonymous user to do so is not really a
    > solution. a better one would be, to make IIS authenticate
    > towards AD as a certain user (e.g. Admin).
    >
    > does anyone know how to do this?
    >
    > thxx
    >
    >
    > >-----Original Message-----
    > >I'm guessing that it's because you need to use
    > Server.CreateObject() instead
    > >of GetObject() for your ASP script...
    > >
    > >
    > >"Treml Juergen" <juergentremlsar-gmbh.com> wrote in
    > message
    > >news:13fc01c381e0$3a785d50$a301280aphx.gbl...
    > >> Hi,
    > >>
    > >> i have a (little) Problem with connecting to the LDAP
    > >> Server.
    > >>
    > >> I need to get a list of all Users and there LoginNames
    > in
    > >> the companie's activedirectory.
    > >>
    > >> The following code works in an normal vbs script:
    > >> Set oContainer=GetObject("LDAP://OU=sar-
    > >> dgf,DC=sar,DC=intern")
    > >>
    > >> But when I use this code in an asp page on the sam
    > >> comptuer, i get an internal server error.
    > >>
    > >> So i have tried this code:
    > >> Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    > >> for each Member in X
    > >> response.write(Member.Name & "<br>")
    > >> next
    > >>
    > >> With this code i at least get back something, which
    > >> is 'CN=System' and 'CN=BuiltIn', but i do not get any
    > >> userlist or grouplist at all.
    > >>
    > >> Does anyone know how to solve this problem? As i said
    > the
    > >> script with the command above works, but not the asp
    > page
    > >> with the same command on the sam computer.
    > >>
    > >> Google dindn't help me at all, so i hope that anyone of
    > >> you ever had that problem and also solved it.
    > >>
    > >> Thxx
    > >>
    > >
    > >
    > >.
    > >

    Tom B Guest

  7. #7

    Default Re: LDAP and ASP - Problem

    Don't you have this same thread going on in asp.components?

    Ray at work

    "Treml Juergen" <juergentremlsar-gmbh.com> wrote in message
    news:028301c381ef$7f82c7f0$a301280aphx.gbl...
    > ok, i found the solution to the problem on my own a few
    > minutes ago, but this led me to another one:
    >
    > the problem was: IIS authenticates towards ActiveDirectory
    > as anonynous which has not the rights to read AD entries.
    >
    > but allowing anonymous user to do so is not really a
    > solution. a better one would be, to make IIS authenticate
    > towards AD as a certain user (e.g. Admin).
    >
    > does anyone know how to do this?
    >
    > thxx
    >
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >i have a (little) Problem with connecting to the LDAP
    > >Server.
    > >
    > >I need to get a list of all Users and there LoginNames in
    > >the companie's activedirectory.
    > >
    > >The following code works in an normal vbs script:
    > >Set oContainer=GetObject("LDAP://OU=sar-
    > >dgf,DC=sar,DC=intern")
    > >
    > >But when I use this code in an asp page on the sam
    > >comptuer, i get an internal server error.
    > >
    > >So i have tried this code:
    > >Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    > >for each Member in X
    > > response.write(Member.Name & "<br>")
    > >next
    > >
    > >With this code i at least get back something, which
    > >is 'CN=System' and 'CN=BuiltIn', but i do not get any
    > >userlist or grouplist at all.
    > >
    > >Does anyone know how to solve this problem? As i said the
    > >script with the command above works, but not the asp page
    > >with the same command on the sam computer.
    > >
    > >Google dindn't help me at all, so i hope that anyone of
    > >you ever had that problem and also solved it.
    > >
    > >Thxx
    > >
    > >.
    > >

    Ray at Guest

  8. #8

    Default Re: LDAP and ASP - Problem

    so far so good

    but if i do what you suggest, everyone can use this asp
    page. i need to make sure two things:

    1) only members of the same domain can view the asp page
    (I need their logins for certain purposes)

    2)IIS authenticates towards ActiveDirectory as either the
    user wich is viewing the page or a certain user which i
    can define (which one of the two solutions doesn't matter)

    the only problem i have is to make step 1 and 2 work at
    the same time.

    any solution for that?



    >-----Original Message-----
    >In IIS administrator, right click your application and
    select properties, on
    >the directory security tab click the "edit" button next
    to Anonymous Access.
    >Enter the username and password of the account you'd like
    IIS to run under
    >
    >
    >"Treml Juergen" <juergentremlsar-gmbh.com> wrote in
    message
    >news:025501c381ef$39fa2ed0$a301280aphx.gbl...
    >> ok, i found the problem myself now, but this leads me to
    >> another one:
    >>
    >> the problem was: IIS authenticates towards
    ActiveDirectory
    >> as anonynous which has not the rights to read AD
    entries.
    >>
    >> but allowing anonymous user to do so is not really a
    >> solution. a better one would be, to make IIS
    authenticate
    >> towards AD as a certain user (e.g. Admin).
    >>
    >> does anyone know how to do this?
    >>
    >> thxx
    >>
    >>
    >> >-----Original Message-----
    >> >I'm guessing that it's because you need to use
    >> Server.CreateObject() instead
    >> >of GetObject() for your ASP script...
    >> >
    >> >
    >> >"Treml Juergen" <juergentremlsar-gmbh.com> wrote in
    >> message
    >> >news:13fc01c381e0$3a785d50$a301280aphx.gbl...
    >> >> Hi,
    >> >>
    >> >> i have a (little) Problem with connecting to the LDAP
    >> >> Server.
    >> >>
    >> >> I need to get a list of all Users and there
    LoginNames
    >> in
    >> >> the companie's activedirectory.
    >> >>
    >> >> The following code works in an normal vbs script:
    >> >> Set oContainer=GetObject("LDAP://OU=sar-
    >> >> dgf,DC=sar,DC=intern")
    >> >>
    >> >> But when I use this code in an asp page on the sam
    >> >> comptuer, i get an internal server error.
    >> >>
    >> >> So i have tried this code:
    >> >> Set X = GetObject("LDAP://mail/dc=sar,dc=intern")
    >> >> for each Member in X
    >> >> response.write(Member.Name & "<br>")
    >> >> next
    >> >>
    >> >> With this code i at least get back something, which
    >> >> is 'CN=System' and 'CN=BuiltIn', but i do not get any
    >> >> userlist or grouplist at all.
    >> >>
    >> >> Does anyone know how to solve this problem? As i said
    >> the
    >> >> script with the command above works, but not the asp
    >> page
    >> >> with the same command on the sam computer.
    >> >>
    >> >> Google dindn't help me at all, so i hope that anyone
    of
    >> >> you ever had that problem and also solved it.
    >> >>
    >> >> Thxx
    >> >>
    >> >
    >> >
    >> >.
    >> >
    >
    >
    >.
    >
    Treml Juergen Guest

Similar Threads

  1. I have a problem with LDAP (Active Directory).
    By Julio Cesar Sosa in forum ASP
    Replies: 7
    Last Post: September 13th, 03:16 AM
  2. W2K AD LDAP Problem
    By xyzbytes in forum Macromedia Contribute Connection Administrtion
    Replies: 0
    Last Post: September 28th, 05:01 PM
  3. Problem installing Net::LDAP
    By perlnewbie in forum PERL Modules
    Replies: 3
    Last Post: September 27th, 10:37 PM
  4. Problem LDAP and Win2003 AD
    By User79 in forum PHP Development
    Replies: 0
    Last Post: December 6th, 10:01 AM
  5. LDAP and ASP - Problem!
    By Treml Juergen in forum ASP Components
    Replies: 0
    Last Post: September 23rd, 02:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139