Exchange Server uses detail (aka display) templates to format and display directory information when users view details about objects in the Global Address List (GAL). Microsoft first introduced templates in Exchange Server 4.0. Exchange Server 2003 still supports 16-bit and 32-bit templates (even though 16-bit support isn't important for most sites), and Messaging API (MAPI) hasn't changed much since Microsoft released Exchange 4.0, so even the earliest Exchange clients can use templates—albeit with less functionality than the most recent version of Outlook.
Although display templates are relatively straightforward in concept and implementation, they aren't well understood, perhaps because the documentation in the Exchange Help file is so skimpy. For this reason, administrators often overlook the value of simple template customizations, such as being able to display the content held in 1 of the 15 custom Active Directory (AD) attributes set aside for organization-specific data. After you understand the basic workings of display templates in Exchange 2003 and Exchange 2000 Server, you can perform simple customizations to modify, add, or remove fields from a template.
When you use Exchange System Manager (ESM) to explore the contents of the Recipients container, which Figure 1 shows, you'll see that Exchange supports two types of templates—details (display) and address. ESM displays these template types with other objects that you might be more familiar with, such as offline address lists.
Clients such as Outlook call display templates to view directory attributes about users, contacts, distribution groups, and public folder objects; address templates let users enter information about email addresses in different formats, such as X.400, Internet (SMTP), or Microsoft Mail. Aside from the X.400 address template, which is the most complex template because you must provide more fields to create an X.400 address compared with any other address type, address templates are straightforward and typically require little or no customization.
Exchange stores template information in the Microsoft Exchange container in the Configuration naming context (NC) of AD. Because templates are organizationwide entities, any change you make to a template affects all servers and all users within the Exchange organization as soon as the change has replicated to the domain controllers (DCs) in your organization. As a result, you must have administrative permissions for the organization before you can make template changes.
Working with Templates
As Figure 2 shows, the Details Templates container consists of several language-specific containers—one for each language that Exchange supports. This organization is important because templates contain information such as labels for the fields that they display. Thus, when you open a language container, ESM uses local language names to list the set of templates. For example, the Arabic template names in Figure 2 equate to User, Group, Public Folder, Search Dialog, Mailbox Agent, Contact, and Exchange Send Options.
Clearly, you need to know which languages the Outlook clients in your organization use when they connect to Exchange. If your organization uses English language clients exclusively, you need to change only the English language templates. In multilingual environments, you need to make the same changes to the templates for every language that your clients use to connect to the server. To begin working with templates, click the language container for the templates that you want to customize, then select a specific template.
Each template contains a set of attributes for the fields that the template activates when a client calls the template to display information about a directory object. The user template is the template most often customized, probably because user objects are the most common objects in the directory and they have the most attributes, and therefore, they offer the largest opportunity for customization. I refer to the user template for the remainder of this discussion.
When you open a template, ESM fetches information about the set of attributes for mail-enabled objects from the AD schema and populates a cache that you can query to select attributes to display in the template. ESM also opens the template design editor to display information about the current layout in the format that Figure 3 shows. Although the template design editor is a bit outdated when compared with most visual design tools, its simplicity might prevent you from getting yourself into too much trouble. You can also click Original to revert to the original template layout if your changes don't work out.
The template design editor lists the controls and values that will display when a user views the template, together with X and Y coordinates that position the controls on the page. Items with the same value for the Y coordinate will line up horizontally; those with the same value for the X coordinate will line up vertically. Let's look at a few of the most commonly used controls:
- Page Break—Indicates the start of a set of fields that are grouped on a separate page (i.e., a tab) within the template. The value for the Page Break control is the text that appears on the tab. For example, the default user template, which Figure 4 shows, has tabs labeled General, Organization, Phone/Notes, Member Of, and E-mail Addresses. All the entry fields that Figure 3 lists are part of the General tab because they're grouped under the Page Break control with the value of General, which you can see at the top of the list. Table 1 lists all the fields in the default user template.
- Label—Holds a language-dependent text string and typically appears alongside another control that holds variable data. You can include the ampersand (&) character in the Label control value to let users navigate to the field by using Alt + letter key combinations. For example, the first Label control that Figure 3 shows has a value of "&First:", meaning that a client displays First in the label (underline under the F), and the user can press Alt+F to move to the first field. This facility is more useful for fields that permit data entry, such as those used to create new email addresses.
- Group Box—Specifies a group of fields that the client will draw a line around when it displays the template. For example, the default user template groups the First, Initials, Last, Display, and Alias fields into a Group box called Name, which Figure 4 shows.
- Edit—Displays only one value for an attribute. For example, a user object has one value for Given-Name (first name), such as Tony.
- Multi-Valued List Box—Displays data for an attribute with multiple values. For example, user objects can have multiple email addresses of different types, which AD holds in a multivalued attribute called Proxy-addresses. The Multi-Valued Drop Down control is a variant of this control type and is used for fields such as the Business 2 and Home 2 phone numbers.
- List Box—Displays data for a list of attributes that come from different objects. Distribution group membership is possibly the best example of this type of list. In the template, the List Box control points to an attribute called Is-Member-Of-DL, which AD uses as a pointer to the distribution groups that the object belongs to.
First, you need to decide whether you truly need to customize a display template. The standard display templates work for most purposes, and you need to consider that every customization drives up support costs because you'll need to verify that the template still works after you upgrade to new Exchange versions or apply service packs. You also need to provide support if users complain that the custom template doesn't work for some reason.
The most common template customizations are adding and removing fields or changing a field's label. For example, assistants are known as administrative assistants in some companies, so you can customize Exchange to comply with your company's culture by changing the Label control associated with the ms-Exch-Assistant-Name attribute to read Admin. Assistant. Likewise, some companies prefer to use the Phone-Home-Primary attribute to store a user's home office phone number. In this case, it's probably a good idea to change the label for this field from Home to Home Office. Or, if your organization is outside the United States, you might want to replace the text of the Zip code label with something more applicable, such as Post Code.
If you decide to remove a field, make sure that you remove both the label and the control that displays the value. If you remove a field and its label from a template, be sure to check the form afterward because you might need to rearrange the remaining fields to restore the form's appearance. You can use the Test command button at any time to see the effects of your changes and to be sure that each change works correctly.
You aren't limited to the set of attributes that the default templates use; you can choose to display any attribute that AD supports for the selected object type. For example, I mentioned earlier that Exchange provides 15 AD attributes called ms-Exch-Extension-Attribute-1 through ms-Exch-Extension-Attribute-15 for companies to use to store custom data about users. Administrators can populate these attributes by updating user objects through the Microsoft Management Console (MMC) Active Directory Users and Computers snap-in, but users can't see the values in these attributes unless you also add them to the user display template. Some companies hold data such as employee identifiers, cost-center numbers, and mail stop details in these attributes.
Let's assume that you store employee identifiers in ms-Exch-Extension-Attribute-9 and want to let users view the information. (Although data and privacy protection practices mandate that you typically restrict such data from general viewing, I use this example because it's easy to understand.) To perform the customization, you need to add two controls to the user display template: a Label control and an Edit control. The Label control holds the text string that you want to display (e.g., "Employee ID"), and we associate or bind the Edit control to the ms-Exch-Extension-Attribute-9 attribute. Use the Add button to add the new controls to the user template, making sure that the X and Y coordinate values of the new controls don't overwrite existing controls. You might want to delete other controls to make room for the new controls or add the new controls to the bottom of the template where more room is usually available. Be careful to line up the new controls with the other controls in the template so that they display properly. For example, the default template uses an X coordinate of 12 for labels and 83 for controls that are bound to attributes. So if you give your Label control an X coordinate of 12, it will line up with the other labels in the template. Similarly, give your new Edit control an X coordinate of 83 (as Figure 5 shows), and it will snap into place. It might take you a couple of attempts to determine the right values for the X and Y coordinates, but it isn't too difficult to eventually display the new field in the right place on the form, as Figure 6 shows. Some people find it helpful to document the layout of a template by printing off a screen capture and noting the values of the X and Y coordinates of all the labels and controls on the printout. Apart from helping you determine the correct value for the X and Y coordinates, the printout will be valuable documentation if you ever need to reapply a customization.
Deploying Custom Templates
You'll want to create the custom template on a test server, then move it into production to prevent users from seeing a partially complete template or one that doesn't look or work right. The only problem in this scenario is that Microsoft doesn't provide any tools to move custom templates between Exchange organizations. Fortunately, although they aren't built for this purpose, you can use the ADSI Edit and Lightweight Directory Access Protocol (LDAP) Data Interchange Format (LDIF) Directory Exchange (Ldifde) tools to export customized template data from the test system and import it into the production system. The sidebar "Deploying Custom Templates" explains how to use these two utilities to deploy custom templates.
Despite the lack of tools and information surrounding the process, customizing display templates isn't difficult and can add value to an Exchange deployment. The important points to consider before beginning a customization are why you want to customize a template and what value you gain; then think through everything and document it before you swing into action.