How to fix missing or duplicate Addressing Templates that cause OAB Generation errors

Addressing Templates are very important to Exchange and the OAB Generation process. There are two types of templates that are located in the Active Directory:

  • Details Templates - Details templates control the appearance of the Address Lists views that appear when a user requests to see recipient properties in Address Lists. You can modify details templates to customize the way information about recipients appears. You can either modify an existing template control or add a new template control to change the appearance of an existing details template. During setup, Exchange installs details templates for many languages other than the English, including the Arabic language.
  • Address Templates - The recipients in your organization use address templates to address messages to mailboxes that are not located in the global address list or in the personal address book. During setup, Exchange installs details templates for many languages other than the English, including the Arabic language.

Missing or duplicate Address-Templates can cause the OAB Generation process to fail. In the latest version of OABInteg I added another verification check to the /t:templatetest function, that will scan the Active Directory and report back all Address-Templates that exist in the Addressing/Address-Templates container. If there are any duplicates OABInteg will report them, and there are any missing you will can look below and the complete list for a comparison.

There are 49 Addressing Templates that reside in the Active Directory. Below is the output from OABInteg validation check:

Starting Test 7 - Addressing Template Validation Test - Check 2

Search started at: 04:55:06 PM

Entry 0: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=401
Entry 1: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=402
Entry 2: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=403
Entry 3: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=404
Entry 4: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=405
Entry 5: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=406
Entry 6: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=407
Entry 7: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=408
Entry 8: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=409
Entry 9: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=40F
Entry 10: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=40b
Entry 11: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=40c
Entry 12: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=40d
Entry 13: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=40e
Entry 14: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=410
Entry 15: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=411
Entry 16: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=412
Entry 17: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=413
Entry 18: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=414
Entry 19: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=415
Entry 20: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=416
Entry 21: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=418
Entry 22: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=419
Entry 23: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=41a
Entry 24: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=41b
Entry 25: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=41d
Entry 26: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=41e
Entry 27: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=41f
Entry 28: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=420
Entry 29: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=421
Entry 30: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=422
Entry 31: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=424
Entry 32: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=425
Entry 33: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=426
Entry 34: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=427
Entry 35: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=429
Entry 36: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=42A
Entry 37: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=42d
Entry 38: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=439
Entry 39: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=43E
Entry 40: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=43F
Entry 41: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=456
Entry 42: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=464
Entry 43: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=804
Entry 44: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=816
Entry 45: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=81A
Entry 46: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=8411
Entry 47: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=C04
Entry 48: /o=OABGen/CN=Configuration/CN=Addressing/CN=Address-Templates/CN=C0A

Search ended at: 04:55:06 PM

Scan Completed
+---------------------+
49 Addressing Templates found
0 Duplicate Addressing Templates found

How to fix missing Address-Templates

The trick to fixing missing Address-Templates is pretty simple.

  • Finding the Address-Template that is missing. OABInteg and this blog will give you that!
  • Export an existing Address-Template using LDIFDE.
  • Modify the exported Address-Template output.
  • Import the modified Address-Template output.

Below are the detailed steps for replacing the missing Address-Templates.

1. Open LDP and select 'Connection' from the menu.
2. Select 'Connect' and type in the domain controller you want to connect to.
3. Select 'OK'.
4. Select 'Connection' from the menu and select 'Bind'.
5. Type in your user, password and domain (domain will be checked).
6. Select 'View' from the menu.
7. Select 'Tree'.
8. For BaseDN paste or type the following:
CN=Address-Templates,CN=Addressing,CN=<YOUR-EXCHORG>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<YOUR_DOMAIN>,DC=<EXTENSION>

Example: CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com

9. Expand this container in LDP.
10. Hit Ctrl+N (This will clear the display in LDP).
11. Double click one of the existing templates.
12. Look for Dn: and copy the Dn to notepad.

Example: CN=401,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com

Now that we have the DN of one of the existing Address-Templates we can export the 4##, 8## or C## Addressing Templates from the addressing container.

NOTE: 4##, 8## and C## means that you need to find one other one that is existing.

13. Run from a command prompt: ldifde -f output.ldf -s domain_controller –d "CN=4##,CN=Address-Templates,CN=Addressing,CN=<YOUR-EXCH-ORG>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<YOURDOMAIN>,DC=<EXTENSION>" -v

NOTE: If everything is ok you will see the following output:

Connecting to "OABGen-DC1"
Logging in as current user using SSPI
Exporting directory to file c:\output.ldf
Searching for entries...
Writing out entries......
6 entries exported

2. Open output.ldf in notepad and perform the following options:

   a. Find and replace all instances of 4## or 8## or C## with the number of the Address-Template that is missing.
b. If you have a different local installed replace all instances of "Language" with "English (US)"
c. Remove all the dSCorePropagationData entries
d. Remove all the instanceType entries
e. Remove all the objectGUID entries
f. Remove all the USNChanged entires
g. Remove all the USNCreated entries
h. Remove all the WhenChanged entries
i. Remove all the WhenCreated entries

NOTE: If your forget to remove one line this import will fail and you will have to remove the template from the active directory using ADSIEdit.msc and then fix the file so you can import it again.

3. Save the modified file as ###.ldf (verify it doesn't get saved with a .TXT extension).
4. Run from a command prompt ldifde -i -k -f input409.ldf -s domain_controller -v

Importing this modified file will create your Address-Template in the Active Directory. If everything is successful you will see the following output:

C:\>ldifde -i -k -f 409.ldf -s dc1 -v
Connecting to "OABGen-DC1"
Logging in as current user using SSPI
Importing directory from file "409.ldf"
Loading entries

1: CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

2: CN=X400,CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

3: CN=MS,CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

4: CN=SMTP,CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

5: CN=MSA,CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

6: CN=CCMAIL,CN=409,CN=Address-Templates,CN=Addressing,CN=OABGen,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyDomain,DC=com
Entry modified successfully.

6 entries modified successfully.
The command has completed successfully

How to fix Duplicate Address-Templates
WARNING- Incorrectly modifying the Active Directory can cause serious problems that may require you to reinstall Exchange and or your entire Exchange Organization. Problems resulting from modifying (Deleting, Changing, Adding, etc) the Active Directory incorrectly may not be able to be resolved, so before making *ANY* modifications back up any valuable data.

1. Load up ADSIEdit.msc
2. Navigate to the following container: CN=Address-Templates,CN=Addressing,CN=<YOUR-EXCHORG>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<YOUR_DOMAIN>,DC=<EXTENSION>
3. Expand the container.
4. Look for the duplicate Address-Template.
5. Delete the duplicate Address-Template.

Dave