
 |
SelfADSI
LDAP Pathnames - Distinguished Names |
 |
This section of the SelfADSI Tutorial deals with LDAP-Filters. Following content is available here:
Distinguished Names
If you want to access a directory object, a special LDAP-Name has to be used for each
object - this applies for single objects as well as for whole containers. For example:
cn=Michael Sandt,ou=Consultants,ou=colleague,dc=cerrotorre,dc=de
Actually, these are no special LDAP-Pathnames, but technical notations
for X.500-Directory Objects . All
directory services that are discussed in the SelfADSI-Project, at least
strive towards compatibility with the
X.500 directory standard.
The notation for X.500-Directory objects is also called Distinguished Name (DN).
Originally, the syntax of Distinguished Names was established at RFC
1779. In the meantime, the more modern
RFC-Specification RFC 2253 applies here.
A Distinguished Name represents
an object in a hierarchical directory, at which the
DN is written from lower to superior hierarchical levels from left to right. Every hierarchy level is written as follows:
keyword=object

The Distinguished
Name for the object 'Philipp Foeckeler' in the domain 'cerrotorre.de' would look like this:
cn=Philipp Foeckeler,ou=Consultants,ou=HR,dc=cerrotorre,dc=de
In this case, the notation for only the object (without the remaining LDAP-Path) would be the so-called Relative
Distinguished Name (RDN):
cn=Philipp Foeckeler
The value of the Relative Distinguished Names
(in this case 'Philipp Foeckeler') is exactly the notation with which the object in the ADS administration is visible, too. It has nothing to do with the displayname of an AD object and can only be changed with the function F2 (Contex menu-> Rename).
The keywords (cn, ou, dc etc.) aren't case sensitive and
have the following meanings:
cn: Common Name
ou: Organisational Unit
dc: Domain Component
These are the three keywords mainly used in Active
Directory LDAP. However, any kind of keyword is possible. Accordingly, other directory systems often might use different keywords for their container objects:
l: Location
o: Organisation
st: State/Province/Federal State
c: Country
The keyword 'organisation' (O) is often used as top level of a non-ADS directory system instead of DC keywords
that always represent the top level at ADS.
<back to top
Complete LDAP Paths
Quite often, not only the Distinguished Name
(DN) of a directory object has to be provided but a complete LDAP pathname, i.e. a URL (Unified Ressource
Locator). Then two elements have to be added to the distinguished name: The label of the LDAP protocol and the server name to which you want to connect:
LDAP://server/distinguished-name
The server is the one to which the
LDAP connection is set up. If the server name is left out, it's always the local PC it refers to. Some examples:
LDAP://cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
LDAP://everest.himalaya.net/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
In this case, the NetBIOS name can be used too:
LDAP://EVEREST/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
IP addresses are possible as well:
LDAP://192.168.57.3/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
Typically, an LDAP connection is set up on
TCP-Port 389. If the server offers its LDAP services under another port, then, like in other URLs, this can be stated together with the server name:
LDAP://everest.himalaya.net:390/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
LDAP://EVEREST:390/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
LDAP://192.168.57.3:390/cn=George Mallory,ou=Alpinist,dc=himlaya,dc=net
In doing so, e.g. the Global
Catalog can be retrieved, which is provided by appropriately configured ADS domain controllers under TCP-Port 3268:
LDAP://everest:3268/dc=himlaya,dc=net
Especially for the LDAP connection to ADS domain controllers, an alternative
LDAP path can be used:
GC://everest/dc=himlaya,dc=net
< back to top
Special Characters in the Distinguished Name
Most of the modern LDAP servers can handle easily the special characters of the ASCII table (for example the german o-umlaut). However, a few restrictions apply when building a Distinguished Name:
1. If object names (RDN names) shall start or end a space character, this must be preceeded with a leading backslash '\'.
2. If the following characters shall be used in an object name, they also have to be escaped with leading backslash '\'.
3. If object names shall start with a "#" this must be preceeded with a leading backslash '\'. Especially for ADS domain controlelrs or ADAM servers it's a strange effect that the system uses the escaping backslash for the '#' at all position in the name string. Normally this is not neccessary, the backslash is only important at the beginning because modern LDAP servers accept a syntax where a name starts with "#" and consist then of a hex code for the name.
A few examples for special characters in the distinguished name:

These objects have the following Distinguished Names:
cn=\ Balrog, ou=LOTR,dc=cerrotorre,dc=de
cn=\#G#o#l#u#m#,ou=LOTR,dc=cerrotorre,dc=de
cn=Blanchet\, Cate,ou=LOTR,dc=cerrotorre,dc=de
cn=Jackson\, Peter,ou=LOTR,dc=cerrotorre,dc=de
cn=Lee\, Christopher \<Saruman\>,ou=LOTR,dc=cerrotorre,dc=de
cn=McKellen\, Ian \+\+Gandalf\+\+,ou=LOTR,dc=cerrotorre,dc=de
< back to top
ADS Domain Names in the LDAP-Path
Again for clarification: As domains still play an important role in the Microsoft directory and domain names of the Active Directory have to be conform with the DNS system, Microsoft uses a special method for representing DNS domain names on X.500-compliant LDAP pathnames. Thereby, the single components of a domain name are split up into separate dc-parts.
Thus, if you want to name an object of the domain emea.support.kashmir.net, the Distinguished Name will e.g. be:
cn=K2,ou=DivisionA,dc=emea,dc=support,dc=kashmir,dc=net

< back to top
ADS-Container
Attention: Not all containers within an ADS domain are OU objects. Somestimes, they may represent CN objects. This applies particularly for the domain containers 'Users', 'Computers', and 'Builtin'.
Thus, it is not:
cn=Administrator,ou=Users,dc=company,dc=de (wrong!!)
But:
cn=Administrator,cn=Users,dc=company,dc=de
(right!!)
This difference can be recognized in the tool 'ADS user
and computer' at the container's icon:
OU-Container
CN-Container
< back to top
Special Pathnames for Exchange 5.5
A little modified LDAP pathname has to be used for accessing Exchange 5.5 directories.
Here, the top hierarchy represents the Exchange oprganisation
and not a domain. Then follows the designation of the
Exchange 5.5 site which contains the object. Afterwards follow recipient or configuration container and according
objects.
The following naming standards apply: cn=Object,cn=Container,cn=Container,ou="Site-Name",o="Organisation"
An example:

The mailbox 'Administrator' in this example would have following Distinguished Name:
cn=Administrator,cn=Recipients,ou=Site-One,o=MAIL55
And the LDAP pathname:
LDAP://KAMET/cn=Administrator,cn=Recipients,ou=Site1,o=MAIL
Attention: Not the object name shown in the display is essential
(e.g. 'Directory Replication'),
but the directory name:

The objects of the Exchange 5.5 configuration can also be accessed via LDAP.

In this case, the priv database would have following Distinguished Name:
cn=Microsoft Private MDB,cn=TRANGO,cn=Servers,cn=Configuration,ou=Site1,o=MAIL
Again, the attributes of the object's directory names are important.
< back to top
Special Pathnames for eDirectory / NDS
In Novell eDirectory environments (formerly known as NDS: Novell Directory Services), LDAP pathames are built by starting simply from the organisation's name - the name of the eDirectory tree is not important. Thus, the top level of the LDAP hierarchy is always the name of the organisation (keyword ' o=') - after that just going through all organizational units up to the actual leaf object. For example:
The user 'admin' in the OU 'server' in the organisation 'cerrotorre' in the tree 'HIMTREE' has the following Distinguished Name:
o=cerrotorre,ou=server,cn=admin
< back to top
back to SelfADSI home
|