2

I'm writing code to connect to my Active Directory server using LDAP. I can connect using

LDAP://celtestdomdc1.celtestdom.local

but I can't connect using

LDAP://celtestdomdc1.celtestdom.local/CN=Users;DC=celtestdom

Am I using the wrong syntax or something?

1 Answer 1

4

Your LDAP string is wrong - use:

LDAP://celtestdomdc1.celtestdom.local/CN=Users,DC=celtestdom,DC=local

or even this (server-less binding - goes to the default DC)

LDAP://CN=Users,DC=celtestdom,DC=local

First, the parts need to be separated by comma (,) not semicolon - and second, you need to use the DC=.... for all DNS-parts of your domain.

<shameless plug>
Also you might want to look at my ADSI browser called Beavertail which is written in C# and 100% free and open-source. It will show you what your domain tree looks like and what the valid LDAP paths are. </shameless plug>

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the beaver tail, that will come in handy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.