Exchange Geek's Weblog

I'm a Geek!

Archive for April, 2008

Active Directory Namespaces

Posted by Milind Naphade on 11/04/2008

The previous post was all about LDAP namespace structure which is defined by IETF in RFCs. So in stead of writing down anything which is not useful lets jump over to a session to understand the Active Directory Namespace structure today.

Typeful Names
The combination of an object’s name and its LDAP designator is called a typeful name. Examples include cn=Administrator and cn=Administrator, cn=Users, dc=Company, dc=com.

Some applications can parse for delimiters such as periods or semicolons between the elements of a distinguished name. For example, an application may permit you to enter Administrator.Users.Company.com rather than the full typeful name. This is called typeless naming. When entering typeless names, it is important to place the delimiters properly.

The console-based tools provided by Microsoft use a GUI to navigate the LDAP namespace, so you don’t need to worry about interpreting typeful or typeless names right away. But if you want to use many of the support tools that come on the Windows Server 2003 CD or in the Resource Kit, or you want to use scripts to manage Active Directory, you’ll need to use typeful naming. After you get the hang of it, rattling off a long typeful name becomes second nature.

Directory Information Tree
In LDAP, as in X.500, the servers that host copies of the information base are called Directory Service Agents, or DSAs. A DSA can host all or part of the information base. The portions of the information base form a hierarchy called a Directory Information Tree, or DIT. Figure shows an example.

The top of the DIT is occupied by a single object. The class of this object is not defined by the LDAP specification. In Active Directory, the object must come from the object class DomainDNS. Because Active Directory uses DNS to structure its namespace, the DomainDNS object is given a DC designator. For example, the object at the top of the tree in Figure would have the distinguished name dc=Company, dc=com.

Typeless Names and Delimiters
If you write scripts and you need to allow for periods in object names, precede the period with a backslash. This tells the parser that the period is a special character, nt a delimiter. For example, if your user names look like tom.collins, a typeless name in a script would look like this: tom\.collins.Users.Company.com. The same is true for user names that have embedded commas and periods, such as Winston H. Borntothepurple, Jr. An ADSI query for this name would look like this: winston h\. borntothepurple\, jr\.

Active Directory and DNS Roots
Active Directory cannot be rooted at the very top of a DNS namespace. The assumption is that many different Active Directory namespaces could share the same root. For this reason, the DomainDNS object at the top of the tree must always have at least two domain component designators.

An LDAP tree contains branches formed by containers underneath the root container. These containers hold objects that have some relation to each other as defined by the namespace. For instance, in Active Directory, the default container for User objects is cn=Users. For Computer objects, it is cn=Computers. Information about group policies, DNS, Remote Access Services, and so forth go in cn=System. As we’ll see when we discuss Active Directory design in Chapter 8,”Designing Windows Server 2003 Domains,” administrators have the ability to create Organizational Units (OUs) to contain objects that have similar management or configuration requirements.
An LDAP tree contains branches formed by containers underneath the root container. These containers hold objects that have some relation to each other as defined by the namespace. For instance, in Active Directory, the default container for User objects is cn=Users. For Computer objects, it is cn=Computers. Information about group policies, DNS, Remote Access Services, and so forth go in cn=System. As we’ll see when we discuss Active Directory design in Chapter 8,”Designing Windows Server 2003 Domains,” administrators have the ability to create Organizational Units (OUs) to contain objects that have similar management or configuration requirements.

Naming Contexts
As the number of objects in a DIT grows, the database may get too large to store efficiently on one DSA. Also, an organization might want to use bandwidth more effectively by using a DSA in New York to store information about users in North America and another DSA in Amsterdam to store information about users in Europe.
Naming Contexts and Partitions
X. 501, “Information Technology—Open Systems Interconnection—The Directory: Models,” defines the term naming context as, “A subtree of entries held in a single master DSA. ” It goes on to describe the process of dividing a tree into multiple naming contexts as partitioning.

Novell chose to adopt the term partition to define separate pieces of the directory database. In their seminal book, Understanding and Deploying LDAP Directory Services, Tim Howe, Mark Smith, and Gordon Good use the term partition in favor of naming context, although they describe both as meaning the same thing. Microsoft uses the two terms interchangeably.

The tools that come with the Windows Server 2003 CD and in the Resource Kit favor the term naming context. That is the term I use throughout this book.

Here is where the distributed nature of an LDAP database comes into play. The Directory Information Base can be separated into parts called naming contexts, or NCs. In Active Directory, each domain represents a separate naming context. Domain controllers in the same domain each have a read/write replica of that Domain naming context. Configuration and Schema objects are stored in their own naming contexts, as are DNS Record objects when using Active Directory Integrated DNS zones.

When a client submits a query for information about a particular object, the system must determine which DSA hosts the naming context that contains that particular object. It does this using the object’s distinguished name and knowledge about the directory topology.

If a DSA cannot respond to a query using information in the naming contexts it hosts, it sends the client a referral to a DSA hosting the next higher or lower naming context in the tree (depending on the distinguished name of the object in the search). The client then submits the request to a DSA hosting the naming context in the referral. This DSA either responds with the information being requested or a referral to another DSA. This is called walking the tree.

DSAs that host copies of the same naming context must replicate changes to each other. It’s important to keep this in mind as you work with Active Directory servers. If you have separate domains, then clients in one domain must walk the tree to get access to Active Directory objects in another domain. If the domain controllers for the domains are in different locations in the WAN, this can slow performance. Many of the architectural decisions you’ll make as you design your system focus on the location, accessibility, and reliability of naming contexts.

LDAP Searches
From a client’s perspective, LDAP operates like a well-run department store. In a department store, you can sidle up to the fragrance counter and ask,”How much is the Chanel No. 5?” and be sure of getting an immediate reply, especially if you already have your credit card in hand. The same is true of LDAP. When a search request is submitted to a DSA that hosts a copy of the naming context containing the objects involved in the search, the DSA can answer the request immediately.

But in a department store, what if you ask the fragrance associate,”

Where can I find a size 16 chambray shirt that looks like a Tommy Hilfiger design but doesn’t cost so darn much?” The associate probably doesn’t know, but gives you directions to the Menswear department. You make your way there and ask your question to an associate standing near the slacks. The associate may not know the answer, but gives you directions to the Bargain Menswear department in the basement behind last year’s Christmas decorations. You proceed to that area and ask an associate your question again. This time you’re either handed a shirt or given an excuse why one isn’t available.

LDAP uses a similar system of referrals to point clients at the DSA that hosts the naming context containing the requested information. These referrals virtually guarantee the success of any lookup so long as the object exists inside the scope of the information base.

The key point to remember is that LDAP referrals put the burden of searching on the clients. This contrasts to X.500, where all the messy search work is handed over to the DSAs. LDAP is Wal-Mart to the Nordstroms of X.500.

RootDSE
When LDAP clients need information from a DSA, they must first bind to the directory service. This authenticates the client and establishes a session for the connection. The client then submits queries for objects and attributes within the directory. This means the client needs to know the security requirements of the DSA along with the structure of the directory service it hosts.

DSAs “advertise” this information by constructing a special object called RootDSE. The RootDSE object acts like a signpost at a rural intersection. It points the way to various important features in the directory service and gives useful information about the service. LDAP clients use this information to select an authentication mechanism and configure their searches.

Each DSA constructs its own copy of RootDSE. The information is not replicated between DSAs. RootDSE is like the eye above the pyramid on the back of a dollar bill. It sits apart from the structure but knows all about it. You’ll be seeing more about RootDSE later in this book in topics that cover scripting. Querying RootDSE for information about Active Directory rather than hard-coding that information into your scripts is a convenient way to make your scripts portable.

LDAP Namespace Structure Summary
Here are the highlights of what you need to remember about the LDAP namespace structure to help you design and administer Active Directory:
• An object’s full path in the LDAP namespace is called its distinguished name. All DNs must be unique.
• The Directory Information Tree, or DIT, is a distributed LDAP database that can be hosted by more than one server.
• The DIT is divided into separate units called naming contexts. A domain controller can host more than one naming context.
• Active Directory uses separate naming contexts to store information about domains in the same DIT.
• When LDAP clients search for an object, LDAP servers refer the clients to servers that host the naming context containing that object. They do this using shared knowledge about the system topology.
• Each DSA creates a RootDSE object that describes the content, controls, and security requirements of the directory service. Clients use this information to select an authentication method and to help formulate their search requests.

Posted in Active Directory Series | Comments Off on Active Directory Namespaces

LDAP Namespace Structure

Posted by Milind Naphade on 08/04/2008

Whatever has been posted till yet was not really so much useful if you consider its application in the real life as the old X.500 architecture and all other things are being rolled out slowly out of the technologies. Most of the messaging technologies have started adopting the SMTP as a standard for mail flow over the internet as well as within the organization too. Microsoft Exchange Server 2007 is one of the initiatives to it.
Anyways, that will take time to get the old technologies out of date, all the matter posted till yet was just to let everyone understand the foundation of AD and how it evolved from an X.500 architecture to today’s real world active directory.
Now starts the actual adventures life of Active Directory that we use as a day to day practice to create users, delete them, modify the user rights, and whatever you can imagine. Yet, before getting in depth of Active Directory and later Exchange Servers I still would like to shed some light on the LDAP namespace structure and how it has been utilized very smartly in design of Active Directory. So, let’s have a look at the LDAP namespace structure which is strictly followed by Microsoft Active Directory Service.

Directory Service has two significant features and those are it is spread across the servers and then the second one is; it allows user to access the information by querying anyone of the servers it is spread across. To get it working, effectively defining a namespace in which each object can be location can be quickly determined. The namespace is structured as follows and contains many new abbreviations in it. They are as follows:

Common Names
As we discussed in the previous posts active directory stores the information in the form of objects and the objects have their own attributes which describe them. For example, a user Dave is stored as an object in active directory database and this object has attributes like his logon name, password, phone number, address, and many others.
When LDAP client needs to locate the information about user Dave it simply passes a query to the active directory to search the phone number of user Dave. This query is always in the form of a distinguished name of the object and contains an attribute which the LDAP client wants to see.
A search for information about Tom Jones could be phrased in a couple of ways:
• You can search for attributes in Tom’s User object. “Give me the Department attribute for cn=Tom Jones, cn=Users, dc=Company, dc=com.”
• You can search for attributes that end up including Tom’s object.” Give me all User objects with a Department attribute equal to Finance.”
In either case, LDAP can find Tom’s object because the name assigned to the object describes its place in the LDAP namespace.

Distinguished Names
A name that includes an object’s entire path to the root of the LDAP namespace is called its distinguished name, or DN. An example DN for a user named CSantana whose object is stored in the cn=Users container in a domain named Company.com would be cn=CSantana, cn=Users, dc=Company, dc=com.

An identifying characteristic of LDAP distinguished names is their little-endian path syntax. As you read from left to right, you travel up the directory tree. This contrasts to file system paths, which run down the tree as you read from left to right.

Relative Distinguished Names
An object name without a path, or a partial path, is called a relative distinguished name, or RDN. The common name cn=CSantana is an example of an RDN. So is cn=CSantana, cn=Users. The RDN serves the same purpose as a path fragment in a filename. It is a convenient navigational shortcut.

Two objects can have the same RDN, but LDAP has a rule that no two objects can have the same DN. This makes sense if you think of the object-oriented nature of the database. Two objects with the same DN would try to occupy the same row in the database table

Posted in Active Directory Series | Comments Off on LDAP Namespace Structure

Classes and Attributes

Posted by Milind Naphade on 07/04/2008

The world of Active Directory does not end right after understanding the classes and attributes there are several other components which need to be understood before saying that you really understand what Active Directory is.
In the implementation of directory service the designers had to take care to reduce down the complexities yet a brilliant performance. To achieve this they had to consider that the classes which are used to define an object with directory service need to be less in numbers.

For example, in a library card catalog, it would be a mistake to create a class called Somewhat-Less-Than-Riveting-Early-20th-Century-American-Novels, even though it seems like quite a few objects would fit in that class. In relation to the overall scope of a library, this classification would be too narrow. It would be better to have an attribute called Boring with a Boolean value. You could assign this attribute to the Book class so that objects derived from that class would get a Boring attribute that could be given a value of Yes or No or left empty. You could also assign the Boring attribute to the Periodical, Tape, and Video classes.

A directory can have hundreds of classes and many hundreds of attributes. If the attributes for each class had to be separately defined, the sheer number of perturbations would make the directory look less like a tree and more like an example of German expressionism.
Fortunately, attributes associated with a particular class often overlap those of other classes. For example, the attribute list for the Mailbox class includes all the attributes associated with the Mail-Recipient class with one addition, the Delivery-Mechanism attribute. So, instead of separately defining all the attributes in Mailbox class, LDAP allows the class to be defined as a child of the Mail-Recipient class. This permits it to inherit the attributes of its parent. The designer need only stipulate the new additional attribute or attributes that make the subordinate class unique.
Flow of the these attributes is like the flow of genes in the family tree. This figure (Seems like there is some problem with scripts running on the create post page so could not upload the relevant image, I will upload the same when the problem is fixed.) may help you to understand the flow.

Object Instances
Each object in Active Directory is derived from a specific object class. Another way of saying this is that an object represents an instance of a class. Each instance of an object class differs from another instance by having different values for its attributes.

Let’s assume that Merrick stands in front of a curious mob and exclaims,”I am not an elephant. I am a human being.” Had Mr. Merrick been a directory services designer, he could have clarified his point by adding, “I am an instance of the Human Being class, not the Elephant class. And the only difference between you and me is a relatively minor attribute of mine that has a different value from yours. So lay off, will you?”

Schema
A database schema defines the content and structure of the database. In a library card catalog, the schema would be a set of procedures and rules set down by the librarian.” Books go on green cards,” she tells you.” Videos go on red cards. File the cards alphabetically by Title in this cabinet and by Subject in that cabinet.” So on and so on. The schema for an LDAP directory service defines these items:

The attributes associated with each object class
The permissible object classes
The parent-child relationship of object classes, which in turn determines attribute inheritance
The data type associated with each attribute
The physical representation of the object in the user interface

Previous two posts were purely intended to help understanding LDAP information model. If you are really interested to understand the LDAP information model in depth then you can certainly have a look at RFC http://www.ietf.org/rfc/rfc2255.txt and then http://www.rfc-editor.org/rfc/rfc4512.txt , there are several actually which explain the standards for the LDAP information model.

Posted in Active Directory Series | Comments Off on Classes and Attributes

LDAP Information Model

Posted by Milind Naphade on 06/04/2008

Continuing the matter of the previous post, this post will contain the information about the LDAP namespace and the LDAP information mode.
For a newbie who always finds it difficult to understand the abbreviations and the terms used in Active Directory explanations ever since, I have tried to explain it in the simplest form with an example that everyone has come across at least once when we were in our school and university days.
As I said in the previous post, the directory database is nothing more than an object oriented database which contains information stored in the form of tables.

To narrow down the scope of the explanation and to simplify the example lets recall that Oak wood cupboard which used to store the books in it (in library off course. Well, being very honest I never used to be a loyal member of any library, so apart from observing and co relating those oak wood cupboards with directory database I never looked at them from any other perspective).
In other words the LDAP information model is somewhat like that old Oak wood cupboard. How? Here is an example.

A directory service may be a bit fancier than the database you use to tally the overtime pay you’ve lost since taking your salaried administrator position a few years back, but the principles of operation are pretty much the same.

Object-Oriented Database

In X.500 terminology, the directory service database is called a Directory Information Base (DIB). If you think of an old-style library card catalog system as a kind of directory service, one of those big oak cabinets with rows of drawers would be a DIB.

The X.500 directory service structure was developed at a time when object-oriented databases represented leading-edge technology. If your only exposure to database technology has been more modern relational databases, the design constraints of an object database can look a little strange.

In an object-oriented database, each record (object) occupies a unique position in a hierarchical namespace. The object’s name and path traces its origins to the top of the namespace, in much the same way that a Daughter of the American Revolution traces her forebears back to the Mayflower. A file system is an example of an object-oriented database.

Object databases consist of big, structured sequential files connected by a set of indexes that are themselves nothing more than big, structured sequential files. This underlying database technology is called Indexed Sequential Access Method, or ISAM. You’ll see this term in the Event log and other reports.

The ESE database engine exposes the flat ISAM structure as a hierarchy of objects. In addition, Microsoft makes extensive use of COM technology by representing Active Directory objects as COM objects via the Active Directory Services Interface (ADSI).

Classes and Attributes
a directory service contains information about specific types of objects, such as User objects, Computer objects, and so forth. These are called object classes. A class is a bundle of attributes with a name.
Attributes and Properties
Attributes are also often called properties. There is a difference between these two terms, but it is so subtle that most reference manuals, including this one, use them interchangeably.

The attributes associated with a particular object class differentiate it from other object classes. For example, User objects have different attributes than Computer objects or IP Security objects. Using a library card catalog as an example, different card formats represent different classes of items. A certain card format is used to record entries for Books. Another format is used for Tapes. The card format for Books would have spaces for Title, Author, ISBN, and so forth. A card for Tapes would have spaces for those entries plus additional spaces for Read-By and Play-Time.

An object class, then, is really nothing more than a bundle of attributes with a name. RFC 2256, “A Summary of the X.500(96) User Schema for use with LDAPv3,” defines 21 classes and 55 attributes for use in a standard LDAP directory service. Active Directory adds quite a few more for a total of about 200 object classes and 1500 attributes.

Classes also define the scope of a directory service database. You would not expect to find cards in a library card catalog representing Off-The-Road Vehicles or Double- Meat Hamburgers. Microsoft engineers defined the initial scope of Active Directory by including a certain set of object classes and attributes. This list can be extended by other applications or by administrators. For example, your organization could create attributes and classes for storing badge numbers and social security numbers in Active Directory.

Posted in Active Directory Series | Comments Off on LDAP Information Model