WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Proper Syntax for an LDAP Path


Question:

Does anyone know the proper syntax for an LDAP path?

For example:

"LDAP://what goes here???"

Answer:

It would look something like:
"LDAP:///"
i.e.
"LDAP://cheech/o=Shelton-NC,c=us"

Suppose your domain is named "mydomain.com" and it has at least a server named "svr":

Here are a few possibilities:

"LDAP://dc=mydomain,dc=com"
"LDAP://cn=Administrator,cn=Users,dc=mydomain,dc=com" ;Bind to default Administrator

"LDAP://mydomain.com/dc=mydomain,dc=com")
"LDAP://svr.mydomain.com/dc=mydomain,dc=com") ;Bind to "svr"
Notice these last two, they use what is called Server Binding as a opposed to Serverless binding. Serverless binding is more robust. Take a look at the last example in particular. If the machine named "svr" is unavailable this will fail. If serverless binding is used instead ADSI will rediscover an up and running Domain controller if at all possible.
Key to LDAP Paths:
---------------------------
dc --> DomainComponent
cn --> CommonName
ou --> OrganizationalUnit
Here is another example:
If the Domain is 'test.microsoft.com', The LDAP path for the domain would be "LDAP://dc=test,dc=mircosoft,dc=com" and the LDAP path for the default Admin might be "LDAP://cn=Adminstrator,cn=Users,dc=test,dc=microsoft,dc=com"

Important:

LDAP paths can get really convoluted. I would suggest a tool from the MS ADSI Resource Kit called ADSVW.exe. It will show you the LDAP paths of objects so you can get a feel for the syntax.
Article ID:   W15819
File Created: 2004:03:30:15:40:58
Last Updated: 2004:03:30:15:40:58