Overview of the OABgen process

I have some free time this week so I figured that I would post a blog in regard to the OAB generation process. As of late I have seen a lot of confusion around the topic of how OABGen works, so here is a high level overview.

 

Offline Address List Generation Overview

The Microsoft Exchange System Attendant is responsible for starting the OAB generation process by invoking OABgen.dll either by scheduled time or via the ESM (Exchange System Manager). OABGen is a MAPI application that reads from Active Directory via NSPI calls.

The Offline Address Book (OAB) is used by Outlook to provide offline access to directory information from the Global Address List (GAL). When OABgen.dll is invoked it will go through the generation process to build the OAB files and place them in a system folder for Outlook clients to download. The OAB files are compressed before they are posted to the system folder so that the download to Outlook is minimal.

Outlook clients are scheduled to check periodically for new OAB files and download the required OAB files.

A healthy and properly configured Active Directory is a necessary component for offline address book generation to work correctly.

 

In addition to address lists, and the objects that make up those lists, the offline address book has its own directory attributes. Issues with Active Directory could result in issues with the offline address book. For examples, interruptions in or a failure of Active Directory replication could prevent newly added directory objects from appearing in the offline address book.

Several Exchange Server components work with Active Directory to generate and maintain offline address books. Once an offline address book has been created (either automatically by Exchange Setup or manually by an administrator using Exchange System Manager), the Exchange Server and the Active Directory will work together to maintain the offline address books, thereby keeping it in sync with changes that may be made in the directory.

Once the offline address books are generated, they are stored in the public folder information store in a system folder. You can use tools like MFCMapi or the Exchange System Manager to view these system folders.

 

Active Directory Issues and the OAB Generation process

Issues with Active Directory could result in issues with the OAB. For example, a Windows account and associated Exchange mailbox are created. There are multiple GC's in the environment. In this example, Active Directory replication is disrupted between the GC's for maintenance procedures. The Exchange server generating the Offline Address book is connecting to a GC which does not have the new account information. Therefore, the new account will not be listed in the OAB.

 

There are many tools and resources to troubleshoot Active Directory issues including the event log, dcdiag.exe, and netdiag.exe. For more information please see:

1. KB Article ID: Q249256 HOW TO: Troubleshoot Intra-Site Replication Failures - https://support.microsoft.com/?id=249256
2. KB Article ID: Q321708 HOW TO: Use the Network Diagnostics Tool (Netdiag.exe) in Windows 2000 - https://support.microsoft.com/?id=321708

 

Exchange Component Overview

Microsoft Exchange Information Store - is responsible for storing the OAB system folders listed directly under the OFFLINE ADDRESS BOOK. Each time a new OAB is created, the corresponding OAB system folders are created. including the containers, such as /o=<OrganizationName>/cn=addrlists/cn=oabs/cn=<name of Offline Address List> during nightly Online maintenance. Tools like OABInteg, MFCMapi and the (ESM) Exchange System Manager can be used to view these messages and attachments.

 

Directory servers - Active Directory servers are utilized in OAB generation. OAB configuration data is stored in the Configuration Naming Context partition in Active Directory, making it available to all domain controllers. In addition, global address list information is stored in global catalog servers.

Recipient Update Service - Although OAB generation does not require the RUS, address lists do require this component. The System Attendant calls the RUS, which in turn maintains the address list membership on recipients. If the address list is blank, OAB generation will fail.

Microsoft Exchange System Attendant – Will load the oabgen.dll into the system attendant process and invoke it directly .

OABGen.dll - Is a MAPI application that reads from Active Directory. The first time an offline address book is generated OABGen will create the OAB Version 2 and OAB Version 3a folders.

Every time OABGen runs, it performs several tasks:

  1. It creates the files for all offline address book versions.
  2. It sorts and compresses the files.
  3. It creates posts in the System Folders for each version of the offline address it is configured to generate. The OAB files will be saved as attachments on the posts in the folders.
  4. Creates incremental OAB files containing daily changes. The default setting on the Exchange Server is to generate an OAB incremental file every morning at 05:00.

 The OAB Generation Process  

The Offline Address Book Generation (OABGEN.DLL) is a MAPI application that reads from the Active Directory and creates Offline Address Lists. OABGen.dll is invoked by the Microsoft Exchange System Attendant service (MAD.exe).

 

When the OAB Generation process is invoked by the Microsoft Exchange System Attendant, it is responsible for connecting to the active directory, read data from the active directory, compiling, sorting, creating and publishing the OAB files to the public folder information store.

 

These files contain a representation of mail enabled objects that are in the Active Directory. These files are downloaded by Microsoft Outlook clients, and uncompressed into individual oab files. Once these oab files have been uncompressed the Microsoft Outlook clients will have a representation of Active Directory objects when they are not able to communicate with the Active Directory.

 

Offline address lists are stored in two locations

 

1. The Active Directory
2. The Microsoft Exchange Public Folder Information Store.

 

When an administrator creates an offline address list in the Active Directory via the ESM (Exchange System Manager) they are creating the placeholders objects in the Active Directory. Once the public folder information store maintenance tasks run, the public folder information store will create the respective folders in its information store. 

 

When an offline address list is generated the OAB Generation process, OABGen.dll will take that data and post it in to the OAB system folders in the form of a message and attachments.

 

The versions of OAB that can be created by OABGen.dll are as follows:

1. (OAB Version 2) ANSI Offline Address Book – This address book format that is used with both Microsoft Exchange 5.5 and Microsoft Exchange 2000. Exchange 2003 also supports the ANSI Offline Address Book. There are some known issues with the ANSI Offline Address Book, especially with those Offline Address Books that have multiple sort locales.

 

2. (OAB Version 3a) Unicode Offline Address Book - This offline address book is new for Exchange 2003. This Offline Address Book has additional information that helps Microsoft Outlook to reduce server Remote Procedure Calls (RPC). Additionally, the Unicode Offline Address Book has new features that are related to sorting rules for different language locales. These features permit Outlook to use the correct sorting rule for the language locale with the Offline Address Book.

 

3. (OAB Version 4) Unicode Offline Address - This offline address book is new for Exchange 2003 with TISP2. This Offline Address Book has additional functionality to help reduce full OAB downloads.

In more detail

An address list can be rebuilt via the ESM (Exchange System Manager) or on schedule. When this happens the Microsoft Exchange System Attendant will invoke oabgen.dll directly and pass along information in regard to the OAB that is to be built.

 

Once the OAB generation process has started OABgen.dll will obtain all of the template information from the active directory, and create the necessary template files. For each client language that the Exchange server supports there will be corresponding template file. These template files are used by the Outlook client to display information about the OAB properties.

After the template files have been created OABGen.dll will query the Active Directory (a domain controller specified in the System Attendant MAPI profile) via NSPI queries for the the address list objects (mailboxes, contacts, dl's etc). OABGen will process each row returned and write the necessary information to a particular temp file in the temporary location on disk. (The servers system temporary directory).

The final step of this of this process is to compare the changes found, create and compress the new message attachments (BROWSE.OAB, DETAILS.OAB, ANRDEX.OAB, RDNDEX.OAB, TMPLTS.OAB) or a(CHANGES.OAB) and post them to the respective OAB system folders.  At this point the OAB files are ready to be downloaded by the client.

NOTE: The data that these files contain can only change if an Exchange Administrator with access changes or modifies the Addressing or Display templates. For more information on Detail Templates please see KB Article ID: Q313962 - How to modify Exchange 2000 or Exchange 2003 details templates https://support.microsoft.com/?id=313962.

The individual files which contain the OAB data:

  • The Anrdex.oab file - This file is an index for resolving ambiguous names.
  • The Browse.oab file - This is the core file. This file contains the object type, the display name, and a pointer in the Details.oab file for each object.
  • The Details.oab file - This file contains all the object details (those that were included in the generation of the Offline Address Book), except for the display name.
  • The Pdndex.oab file - This file contains the changes to domain names and the lists thereof.
  • The Rdndex.oab file - This file is an index for resolving relative distinguished names.
  • The Tmplts.oab file - This file contains strings for dialog boxes and for any other items that are static in the Offline Address Book. Therefore, this file does not increase if you add additional objects to your directory.

Unicode File Types

  • The Uanrdex.oab file - This file is the Unicode version of the Anrdex.oab file.
  • The Ubrowse.oab file - This file is the Unicode version of the Browse.oab file.
  • The Udetails.oab file - This file is the Unicode version of the Details.oab file.
  • The Updndex.oab file - This file is the Unicode version of the Pdndex.oab file.
  • The Urdndex.oab file - This file is the Unicode version of the Rdndex.oab file.
  • The Utmplts.oab file - This file is the Unicode version of the Tmplts.oab file.

For more information on the OAB Generation process and how to troubleshoot it, please see blog -> https://blogs.msdn.com/dgoldman/archive/2005/07.aspx

 

Mandatory Attributes of an Offline Address List

addressBookRoots - Exchange will use this attribute to configure trees of address book containers to show up in the MAPI address book. This attribute can be found on the properties of the Exchange Configuration Object, and lists all roots of the address book container trees.

offlineABContainers - A multi-valued distinguished name attribute that stores a list of distinguished names of address lists that should be included in this Offline Address Book.

offlineABServer - A single-valued distinguished name attribute that stores the distinguished name of the server that is responsible for generating this Offline Address Book. The server must be an Exchange 2000 Server.

doOABVersion - A single-valued integer attribute that stores compatibility information of this specific address book with different versions of Exchange. This attribute can be set to either "0" or "1". (Any other value is reserved for future use.) A value of 0 indicates that this address book is not required to be compatible with versions 4.0 and 5.0 of Exchange. A value of 1 indicates that this address book should be compatible with versions 4.0 and 5.0 of Exchange in addition to Exchange 5.5 and 2000.

msExchOABFolder - A single-valued octet string attribute that is always set to a variant array with one element that stores a zero-byte array. Its existence is solely due to legacy systems.

offlineABSchedule - A single-valued octet string attribute that is set to a byte array of size 84 that stores the Offline Address Book update interval schedule. Each bit in this structure represents a 15-minute increment, starting from 12 AM Sunday. Each byte in this structure represents a 2-hour increment. Set the bit to "1" to schedule to run at the 15-minute interval.

offlineABStyle - A single-valued integer attribute that indicates more general exchange schedule information as follows:

0 = Never run. This is the same as setting each byte in the schedule blob in offlineABSchedule attribute to "0x00".

1 = Run as specified by the schedule blob stored in the offlineABSchedule attribute.

2 = Run always. This is the same as setting each byte in the schedule blob in offlineABSchedule attribute to "0xFF". 

 

legacyExchangeDN - A single-valued distinguished name attribute that stores the legacyExchangeDN of the Exchange Organization to which this address list belongs. Exchange System Manager creates it as "<legacy domain name of the organization>/cn=addrlists/cn=oabs/cn=<legacy container name for the oab>".

msExchOABDefault - A single-valued Boolean attribute that stores a value of either "True" or "False". If set to True, it indicates that this is the default Offline Address Book for any mailbox store if not explicitly specified for that store. Only one Offline Address Book should have this value set to True.

systemFlags - A single-valued integer attribute that stores system information regarding the directory object. Although this is an optional attribute, it must be set at creation time as well. This attribute is set by passing a value that is defined by the ADS_SYSTEMFLAG_ENUM enumeration, which is documented at: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/ads_systemflag_enum.asp

siteFolderGUID - A single-valued octet string attribute that is set to a random unique globally unique identifier (GUID) value for the Offline Address Book.

siteFolderServer - A single-valued distinguished name attribute that stores the distinguished name of the public folder store where you want the Offline Address Book to exist. The public folder store should be on the same server as offLineABServer to avoid network traffic.

msExchPurportedSearcyUIArray - A multi-valued attribute that stores the parameters necessary to rebuild the Exchange System Manager's Offline Address Book query filter dialog for this Offline Address Book. This attribute does not have to be set. If it does not have a value set, then the Modify button on the Offline Address Book's properties, when viewed through Exchange System Manager (ESM), would be disabled. Modifying this attribute is not supported and there is no documentation on how to customize this property. The best way to customize it programmatically is to create an OAB using a similar query filter from Exchange System Manager and copying the values of this attribute and pasting them into your code to make a new OAB that you are creating programmatically.

For more information on how an Outlook client downloads the OAB files, please see post -> https://blogs.msdn.com/dgoldman/archive/2005/04/28/413043.aspx