Platform SDK: Active Directory, ADSI, and Directory Services

LDAP Binding String

The LDAP provider's binding string has the following format:

LDAP://HostName[:PortNumber][/DistinguishedName]

Where HostName can be a computer name, an IP address, or a domain name.

Like the WinNT case, a server name may be specified in a binding string. Most LDAP servers follow a model that requires the server name to be specified. For example, to bind to an Exchange Server, you must specify an Exchange server name.

If no port number is specified, the LDAP provider uses the default port number, that is, 389. This is useful in some scenarios. For example, an Exchange Server 5.x may be installed on top of Active Directory™. Since both use 389 as a default port number, you must configure Exchange to use a different port number. Then, the client will be able to talk to both Active Directory and Exchange using two different ports on the same machine.

To bind to a specific object, you must specify the distinguished name of the object. A distinguished name (DN) for a given object is guaranteed to be unique.

Examples of binding to a specific object are shown in the following table.

Binding string Meaning
LDAP://dc01
Bind to the dc01 domain controller.
LDAP://exch01.Microsoft.com
Bind to an Exchange server.
LDAP://exch01:390
Bind to an Exchange server and specify the port number.