Re: ldap connection problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Have you tried using ADSIEdit or ADSIView yet? (Does it work?)
---Yes i tried connecting using ldp.exe and it does work. Since it does not
require a username and password to connect it allows me to connect and shows
me search values if i do a search.

Does this work in a console app?
---I tried doing a desktop application using Vb.net. Gives me the same error
that i get through a web application. It bombs out at the line
osearcher.FindOne with the same stupid error "Unknown Error(0x80005000)"

> Is your LDAP string is correct?
---My LDAP String is correct i believe because i used the same string in the
windows support tool application ldp.exe as mentioned above and it works.
Probably i am not using it in the right format in my asp.net application and
you could guide me there. I have mentioned what i use in my first question to
which you replied

> Is " LDAP://directory.x.y/ou=People,dc=x,dc=y"; the actual LDAP string?
--- No this is just an example string. I have some values for x and y that
correspond to my ldap server. I can tell u these if you want.

> Is the IIS server trusted at the respective domain you're trying to
> search?
---I dont know because the LDAP server is on the college campus servers and
i have no access to that server. Also, as per your suggestion it should not
matter because if a desktop application should work then i dont need a web
application and we can leave IIS out of this.

> Have you tried filtering using another property (like SAMAccountName)?
--- I thought this property could only be used for windows 95,98,NT4
machines. If i am wrong please post an example with the use of this property.
I will appreciate that.

> You can also try using DirectoryEntry("LDAP...", null, null,
> AutheticationTypes.Secure);
---I tried using that. Still the same problem. Also as i mentioned i dont
need to use authenticationtypes.secure because i can bind anonymously to this
ldap server thats what the campus people who have this server tell me.

Please help me!! Thanks for all your help till now. I really appreciate your
looking into this problem. Looking forward to your reply.

"Erick Sgarbi" wrote:

> Have you tried using ADSIEdit or ADSIView yet? (Does it work?)
> Does this work in a console app?
> Is your LDAP string is correct?
> Is " LDAP://directory.x.y/ou=People,dc=x,dc=y"; the actual LDAP string?
> Is the IIS server trusted at the respective domain you're trying to
> search?
> Have you tried filtering using another property (like SAMAccountName)?
>
> I am sure after answering these questions someone will be able to help.
> You can also try using DirectoryEntry("LDAP...", null, null,
> AutheticationTypes.Secure);
>
>
> Erick Sgarbi
> www.blog.csharpbox.com
>
>
>
> "Amar" <Amar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:165A24BE-F601-4974-8BD6-F150B6CD23F3@xxxxxxxxxxxxx:
>
> > Thank you for looking into the matter.
> > I tried implementing the primary token thing but it is of no avail.
> > Paul, currently my application is using "Anonymous" user on IIS and IIS
> > controls the password for the user. I also have the statement "<identity
> > impersonate="true"/>"
> > set in my web.config file.
> > What i dont understand is that the college ldap server required no
> > authentication and i can bind anonymously.
> > I really appreciate your help.Looking forward to your reply!
> > Thanks
> >
> > "Paul Clement" wrote:
> >
> > > On Tue, 2 Aug 2005 06:11:05 -0700, "Amar" <Amar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > ¤ I am trying to connect to my college LDAP directory using ASP.NET. This LDap
> > > ¤ does not have security as it returns only user demographic information.
> > > ¤ i do not need to bind with a username or credentials.
> > > ¤ What i am trying to do is, i am trying to look up all the information for
> > > ¤ the user with user id 'testuser'. The following is the Vb.net code for my
> > > ¤ aspx page:
> > > ¤
> > > ¤ Dim oRoot As DirectoryEntry = New
> > > ¤ DirectoryEntry("LDAP://directory.x.y/ou=People,dc=x,dc=y";)
> > > ¤ Dim oSearcher As DirectorySearcher = New DirectorySearcher(oRoot)
> > > ¤ Dim oResult As SearchResult
> > > ¤ Dim propName As String
> > > ¤ Dim obProp As Object
> > > ¤
> > > ¤ Try
> > > ¤ oSearcher.Filter = "uupid=testuser"
> > > ¤ oResult = oSearcher.FindOne
> > > ¤ For Each propName In oResult.Properties.PropertyNames
> > > ¤ For Each obProp In oResult.Properties(propName)
> > > ¤ Response.Write("name= " & propName)
> > > ¤ Response.Write("value= " & obProp)
> > > ¤ Next
> > > ¤ Next
> > > ¤ Catch Ex as Exception
> > > ¤ End Try
> > > ¤
> > > ¤ The above code fails at the line "oResult = oSearcher.FindOne" and gives me
> > > ¤ an error which is useless: "Unknown error (0x80005000)"
> > > ¤ I have already posted this question twice. Is there nobody whos faced this
> > > ¤ problem?
> > > ¤ Please help me!! Thanks in advance.
> > >
> > > Sounds like it might be a credentials issue. What level of security is set for your web application
> > > in IIS? Are you implementing impersonation?
> > >
> > >
> > > Paul
> > > ~~~~
> > > Microsoft MVP (Visual Basic)
> > >
>
>
.



Relevant Pages

  • Re: possible hacking on my network
    ... Then you realy, realy need to look into It, if you dont use it, dont know ... Windows Small Business Server 2003 Technical Library ... SBS Standard shows mostly the same ports, ...
    (microsoft.public.windows.server.sbs)
  • Re: Upgrading from a Windows 2000 domain
    ... Please post the results from running the following command at a command ... LDAP query to speficied LDAP server on TCP port 389 failed ... When I run Adprep /forestprep it is not ...
    (microsoft.public.windows.server.active_directory)
  • Re: hardware question
    ... This is a hot topic, but Microsoft states that they dont support Configuration Manager on VMWare, but I have all my test environment on VMWare untill i recently switched it to Hyper-V without any issues, but pleae check with your TAM or local Microsoft representative on that. ... server and two distribution servers. ...
    (microsoft.public.sms.misc)
  • Re: Upgrading from a Windows 2000 domain
    ... Here are the results of dnslint your requested me to run: ... LDAP query to speficied LDAP server on TCP port 389 failed ... When I run Adprep /forestprep it is not ...
    (microsoft.public.windows.server.active_directory)
  • Issues with OpenLDAP 2.4.15 and FreeBSD 8.0-CUrrent as well as with FreeBSD 7.2-PRE using DB
    ... First I see on all FreeBSD flavours a coredump of LDAP clients when doing ldapsearch, ... Another very severe issue is with Db 4.7 and OpenLDAP 2.4.15 as taken from ports. ... Several experimental boxes with FreeBSD 8.0-CURRENT and FreeBSD 7.1/7.2 were referring to that LDAP server for user authetication. ...
    (freebsd-current)