Dear friends,
I've got a strange issue with Exchange server 2013. I am unable to configure profile with my own application.
The function ConfigureMsgService returns MAPI_E_NETWORK_ERROR (0x80040115).
The point of failure is this:
// Property structure to hold values we want to set.
#define PROPERTIES_NUM 5
SPropValue propValues[PROPERTIES_NUM];
memset(&propValues, 0, PROPERTIES_NUM * sizeof(SPropValue));
// PR_ROH_FLAGS
propValues[0].ulPropTag = PR_ROH_FLAGS;
propValues[0].Value.l = ROHFLAGS_USE_ROH |
ROHFLAGS_HTTP_FIRST_ON_SLOW |
ROHFLAGS_HTTP_FIRST_ON_FAST;
// PR_ROH_PROXY_AUTH_SCHEME
propValues[1].ulPropTag = PR_ROH_PROXY_AUTH_SCHEME;
propValues[1].Value.l = ROHAUTH_NTLM;
// PR_ROH_PROXY_SERVER
propValues[2].ulPropTag = PR_ROH_PROXY_SERVER;
propValues[2].Value.lpszW = (LPWSTR) wszRohProxyServer;
// Server
propValues[3].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
propValues[3].Value.lpszA = (LPSTR) szServer;
// Email
propValues[4].ulPropTag = PR_PROFILE_UNRESOLVED_NAME;
propValues[4].Value.lpszA = (LPSTR) szEmailAddress;
// Configure the message service with the properties above.
hr = spMsgSvcAdmin->ConfigureMsgService(
(LPMAPIUID) pRow->aRow->lpProps[iSvcUID].Value.bin.lpb,
NULL, 0/*SERVICE_UI_ALLOWED*/, PROPERTIES_NUM, propValues );
This works well if SERVICE_UI_ALLOWED flag is used but fails with MAPI_E_NETWORK_ERROR
if "MSEMS" service is configured without configuration property sheet.
The code above also works if Exchange server is installed at the computer that also works as domain controller. But the problem occurrs if domain controller and exchange server are separate machines.
Enviroment:
Domain controller: Windows Server 2012
Exchange server: Windows Server 2012, Exchange 2013
Client machine: Outlook 2013 installed
I'm guessing that there is some issue with AD, but I've run out of ideas at this point.
Many thanks in advance for any suggestions.
tomas