Platform SDK: Active Directory, ADSI, and Directory Services |
To write ADSI applications that access the Microsoft Exchange directory, it is useful to have an understanding of the Microsoft Exchange directory schema. The directory schema is a collection of descriptions, or rules, that define characteristics of objects in the directory. The schema defines available object classes in the directory, relationships between object classes, attributes of each object class, and specific characteristics of attributes and classes.
To return to the file system analogy, you can have many different types of files on your hard drive. Each file type has inherent qualities and characteristics that govern its format and present its information in ways required by the applications that access it. In the Microsoft Exchange directory these object definitions are called classes. Classes define the characteristics of objects created with a particular class type. You can have many objects in the directory with the same class. Different classes can also be stored in the directory.
Each class describes a set of attributes (or fields of information) that are either mandatory or optional. The class definition includes all the data for the class attributes, including attribute name, length, data type, and so on.
Each mandatory attribute must have a value that is valid in terms of length, data type, and so on. Optional attributes do not need to contain a value. However, if the value is present, it must conform to the length and data type dictated by the object class. Attributes can contain single or multiple values depending on the class definition. For example, the Members field on a Distribution List contains multiple values, the Directory Name field contains a single value.
The full list of object classes and the definition of each class is defined in the schema.
Class definitions are constructed hierarchically. Each derived class inherits all of its parents' attributes. All directory classes are derived from a class called Top.
The Exchange Server schema is not extensible. This means that you cannot add new classes or attributes to the directory. However, Exchange Server does provide you with 15 custom attributes for all directory objects derived from Mail-Recipient. Ten of these attributes are available in Exchange 4.0 and 5.0, and five additional attributes are available in Exchange 5.5. Custom attributes 1 through 10 are 1024 bytes long and can be viewed in the Exchange Administrator application. Custom Attributes 11 through 15 are 2048 bytes long and are only available in Exchange Administrator raw mode, or programmatically. This includes the Exchange Administrator's import and export functions, as well as ADSI.
ADSI is a directory access mechanism. With ADSI, you can access or modify any object in the directory. It is important to differentiate clearly between information that is stored in the Microsoft Exchange directory, and information stored elsewhere. ADSI cannot modify objects in the Exchange Information Stores. Hence, you cannot use ADSI to modify permissions on a public folder, because that information is not in the directory.
Note One special attribute of particular interest to directory programmers is the "Back Link" attribute. This attribute creates an association between the values defined on many objects and a single value on another object. For example, if everyone in the world was allowed to declare one other person in the world as a friend, how could you ever find out who has declared you a friend? You would have to ask everyone in the world who they have defined as their friend and maintain a list. A much more effective solution is to maintain an attribute (in this case containing multiple values) that links to all the people who have declared you as their friend. The Exchange directory keeps track of this sort of information for certain attributes. For example, on each mailbox object there is an attribute containing the name of the mailbox's home server information store (Home-MDB). To find the list of all the mailboxes represented by a directory object (class: MHS-Message-Store), the directory maintains an attribute called Home-MDB-BL. Home-MDB-BL is a property with multiple values containing all of the mailboxes that have declared this store as their home information store.