The DS Server registry key and rebuilding an Offline Address List

I wanted to talk briefly about using the DS Server registry value for hard coding Exchange servers to particular domain controllers, and the problems that it can cause.

The DS Server registry key was used back in the day as a means to hard code an Outlook client so it could use a particular domain controller. This was used to help redirect Outlook clients in the event of problem with certain domain controllers in an environment. Outlook clients and Microsoft Exchange servers specifically the System Attendant service (mad.exe) both use MAPI profiles for logging on to an Microsoft Exchange information store.

Below I will outline a high level overview on how MAPI clients use the DS Server registry value.

When a profile is created by an Exchange Server or Outlook client for the first time, we will write the current setting values (the global catalog server being use is one of them) to the following registry key:

Registry Location: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\<profile_name>\dca740c8c042101ab4b908002b2fe182
Registry Value name: 001e6602
Registry Value type: String

We will also write certain OAB data values to the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Exchange\Exchange Provider after the client has logged in for the first time and preformed a full OAB download.

Now anytime we logon with this profile we will follow this logic for logging on:

1. Check for the preceding registry key HKEY_CURRENT_USER\Software\Microsoft\Exchange\Exchange Provider\ and look for the "DS Server" value.

2. If this value is populated with a domain controllers name, the MAPI client will attempt to bind to the directory service interface for that specified domain controller.

If the global catalog server is available, Outlook will continue to use that global catalog server and only this domain controller.

If the global catalog server is not available the Outlook client will fail to bind to the directory service on the domain controller.

NOTE: If the DS Server registry key is not being used and the prior used domain controller is not available, the Outlook Client will ask the Microsoft Exchange Server for a new global catalog server referral. Once the client has been given back this referral the Outlook client will then attempt to communicate with that new domain controller.

Now using the DS Server registry key on a Microsoft Exchange server is bad!! If the DS Server registry key value is present but the global catalog server is not available, the System Attendant will throw a provider error and fail to log on. This will halt all communications from the System Attendant to the active directory, and can cause your Exchange server to stay is a decommissioned state until this value has been removed.

This Event ID can be seen in the application log as follows:

Event ID : 9175
Event Type : Error
Event Source : MSExchangeSA
Event Category : MAPI Session
Description : The MAPI call 'OpenMsgStore' failed with the following error: The information store could not be opened. The logon to the Microsoft Exchange Server computer failed. MAPI 1.0 ID no: 80040111-0286-00000000

If you were trying to generate an Offline Address List from the ESM (Exchange System Manager) there will be a dialog pop-up box with an error:

MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000
ID no: c1050000 Exchange System Manager

There will also be additional Event ID's that will be present in the application log if you are attempting to generate an Offline Address List:

Event ID : 9108
Event Type : Information
Event Source : MSExchangeSA
Event Category : (13)
Description : Offline Address List is being generated for \Global Address List.

Event ID : 9126
Event Type : Error
Event Source : MSExchangeSA
Event Category : (13)
Description : OALGen encountered error [0x80004005] while calculating this OAL. This OAL will not be available for client download. (\Global Address List)

Event ID : 9175
Event Type : Error
Event Source : MSExchangeSA
Event Category : MAPI Session
Description : The MAPI call 'OpenMsgStore' failed with the following error: The information store could not be opened. The logon to the Microsoft Exchange Server computer failed. MAPI 1.0 ID no: 80040111-0286-00000000

Using the err.exe (Microsoft Exchange Server Error Code Look-up Tool) you can look up both error codes:

C:\WINXP\system32>err 0x80004005
# for hex 0x80004005 / decimal -2147467259
ecError ec.h
MAPI_E_CALL_FAILED mapicode.h

C:\WINXP\system32>err 80040111
# for hex 0x80040111 / decimal -2147221231
ecLoginFailure ec.h
MAPI_E_LOGON_FAILED mapicode.h

The fix for this is to remove the DS Server registry key.
Warning: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use the Registry Editor at your own risk.

Steps for removing the DS Server Registry key:
1. Start Registry Editor (Regedt32.exe).
2. Locate the DS Server value under the following key in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Exchange Provider
3. Click the ‘DS Server’ key
4. Click ‘Edit’
5. Click ‘Delete’
6. Click ‘Yes’ to confirm the deletion.
7. Quit Registry Editor. 

Once you have confirmed that the DS Server registry value has been remove you can restart the System Attendant service and it should start up.

For more information on how the System Attendant uses a MAPI profile to build an Offline Address List see this blog: How does OABGen know what domain controller to connect to?

Dave