How to use the same profile to connect to both Exchange 2013 and legacy versions of Exchange Server

As promised in my previous post, here is an post which walks you through the creation of a profile which can be used to connect to both an Exchange 2013 Server as well as a legacy version of Exchange Server (2007, 2010).  The reason why this is needed is because their is an explicit block in place that prevents profiles configured to use RPC over HTTP to interact with legacy versions of Exchange Server.  Therefore, the standard mechanism of profile creation won't work.  To get this working you will need to utilize a registry value named RpcHttpProxyMap.  You can read more about this registry value and it's various settings in the MAPI guidance document published with the latest version of the MAPI/CDO download.  The steps below will walk you through creating a profile that uses this value in addition to the properties configured in the profile.  Although not a prerequisite, it may be helpful to review my previous posts about profile creation with MFCMAPI before walking through this one.

These steps require that the version of MAPI/CDO is at least 6.5.8309 and the latest version of MFCMAPI. These steps will not work with any version of Microsoft Outlook.

Important This section contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following Microsoft TechNet article: Backing Up and Restoring the Registry

  1. Make sure that you have Exchange 2013 properly configured.  The best way to do this is confirm that Microsoft Outlook can connect successfully.
  2. Create a REG_SZ value named RpcHttpProxyMap_MFCMAPI in the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Windows Messaging Subsystem
  3. Populate this key with the domain suffix of the personalized server id (the domain part that is right of the '@' symbol, e.g. F5FA...5591@contoso.com) then an equal sign followed by the FQDN of the Rpc Proxy Server, followed by a comma then the proxy server settings in the format RpcHttpAuthenticationMethod, RpcAuthenticationMethod, and then indicate what the subsystem should do when an invalid certificate is encountered.  A value of 'true' indicates that invalid certificates should be ignored.  For example, contoso.com=mail.contoso.com,ntlm,ntlm,false
  4. Open up MFCMAPI, go to Profile > Show Profiles
  5. Click Actions > Create Profile
  6. Give the new profile a name and click OK.
  7. Select the new profile
  8. Right-Click and choose Services > Add Service...
  9. Enter MSEMS for the service name
  10. Uncheck the box which says 'Display Service UI'
  11. Click OK
  12. Double-click the newly created profile
  13. Double-click the MSEMS service
  14. Find the Global Profile Section.  It's the provider with the PROVIDER_UID that is 13DBB0C8AA05101A9BB000AA002FC45A and single click it.
  15. Go to Property > Additional Properties
  16. Click Add and add the following properties PR_PROFILE_UNRESOLVED_NAME, PR_PROFILE_UNRESOLVED_SERVER
  17. Click OK
  18. Configure each property using the guidance below.
    Property: PR_PROFILE_UNRESOLVED_NAME
    Value: mailbox alias
    The alias for the target mailbox. For example, Administrator
    Property: PR_PROFILE_UNRESOLVED_SERVER
    Value: The personalized server id
    This is the value retrieved from Autodiscover. It will be in the format guid@domain. For example, F5FA2827-5978-43cd-8FA8-E07BC3BB5591@contoso.com
    Property: PR_PROFILE_CONNECT_FLAGS
    Value: CONNECT_USE_SEPARATE_CONNECTION (0x4) | CONNECT_IGNORE_NO_PF (0x8000)
    Tells the subsystem to use a separate connection and still connect if no public folders are in the organization
  19. Select Session > Logon and display store, and select the profile is not already selected.

The steps above will connect you to a mailbox residing on an Exchange 2013 Server.  From there you can use MDB > Open other mailboxes >  From GAL... to connect to a mailbox residing on a legacy version of Exchange Server.  If you want to connect first to the mailbox on the legacy version of Exchange Server use the same steps but in step 17, use the target server's name for PR_PROFILE_UNRESOLVED_SERVER instead of the personalized server id.  Additionally, you may need to specify PR_PROFILE_UI_STATE if RPC encryption is enabled on the target legacy Exchange Server.  This is the default in Exchange 2010.  Please see my previous post on profile creation for Exchange 2010 for setting the value of that property.

The personalized server id is the server name returned from Autodiscover. You can find this in a variety of ways. If you are using the SOAP based Autodiscover the property you are looking for is InternalRpcClientServer. If you are using the Plain Old XML (POX) based Autodiscover the property you are looking for is of type EXHTTP in the protocol node. The node name is Server. You can use Outlook to make an Autodiscover request on your behalf by right clicking the Outlook icon in the System Tray while holding down the CTRL button and choosing 'Test E-Mail Autoconfiguration'.

It is recommended that you add a suffix to the RpcHttpProxyMap which is unique. This avoids conflicts with other MAPI applications that may be running on the machine.  I added "_MFCMAPI" to the value's name for this purpose.

The RpcHttpProxyMap value's data is case sensitive if using version 6.5.8309.  Therefore, "contoso.com=mail.contoso.com,ntlm,ntlm,false" is not the same as "Contoso.com=mail.contoso.com",ntlm,ntlm,false.  This was changed in 6.5.8320 and is no longer case sensitive.

Properties configured in the profile will always override the registry key.  Therefore, when the properties in the profile are in conflict to the properties in the registry MAPI will use the properties in the profile.

Lastly, the version of MAPI/CDO was incorrectly stated on the download page as 8.3.8309 for 6.5.8309.