I had another case involving creating a profile to an Exchange 2013 server. However, this time it was for Outlook’s MAPI, not Exchange’s MAPI as previously documented. After discussing this with the Outlook product team they agreed to document the minimum number of properties to create a profile using MFCMAPI. Here are the steps. For the non-developers this is not the recommended way to create profiles. It is recommended that you use Outlook to create the profile as the logic for this is all built-in. However, you can use these steps for troubleshooting purposes.
Please bear in mind that the property values above may vary for your particular organization. That is why I included the location in the Autodiscover response where you can find the setting for a particular profile. The settings above worked in my environment but may not work in yours. If you are having trouble, the best thing to do is to review the Autodiscover response for the target mailbox to ensure that it matches the values I specify above. If it doesn’t, you should change the values accordingly.
Notes for Developers
In the canonical example of creating a profile, Microsoft shows how to create the service then call IMsgServiceAdmin::ConfigureMsgService() to set the PR_PROFILE_UNRESOLVED_NAME and PR_PROFILE_UNRESOLVED_SERVER properties. However, since Outlook 2010 no longer uses the Global Profile Section this didn’t work for me. What I had to do was to call IMAPIProp::SetProps() on the Exchange Profile Section with the properties above to get the profile to properly connect.
Setting the properties on the profile SHOULD be done before calling MAPILogonEx()
You can avoid being authenticated as well as querying the directory server by not using the “unresolved” properties (e.g. PR_PROFILE_UNRESOLVED_NAME). You can get the information from Autodiscover yourself and populate the values for the following properties.
If you have questions, just add a comment and I will approve them and respond as time permits.
[Edit: 7/8/2014 Added screenshots]