Hi Every one
I need exchange server name for the user mailbox in our ICC outlook extension code.
I found that profile property PR_PROFILE_HOME_SERVER_DN(The server name for the mailbox) does not exist if user profile is created by outlook 2016.
(The property PR_PROFILE_HOME_SERVER_DN is only exist if user profile is created by outlook 2007/2010/2013 ).
So that some functionality in our ICC outlook extension like restore mail/mail’s (which was archived by any achieving server like ICC server) is not working with exchange online and outlook2016. When outlook 2016 is connected to exchange online with MAPI over HTTP protocol.
The following code snippet, we are using for getting Server DN in our ICC outlook extension code.
tracer.TRACEinf ("Created MAPI session");
LPPROFSECT lpProfSect;
hr = lpSess->OpenProfileSection((LPMAPIUID)pbGlobalProfileSectionGuid, NULL, 0, &lpProfSect);
if(SUCCEEDED(hr))
{
LPSPropValue lpPropValue;
hr = HrGetOneProp(lpProfSect, PR_PROFILE_HOME_SERVER_DN, &lpPropValue);
if(SUCCEEDED(hr))
{
tracer.TRACEinf ("Server DN: %s\n", lpPropValue->Value.lpszA);
MAPIFreeBuffer(lpPropValue);
}
lpProfSect->Release();
}
In our ICC outlook extension code we have also alternative to parse server DN name from autodiscover xml file which send by exchange server during outlook initialization.
autodiscover xml file snippet like following
email
settings
EXCH
VM902142.ecmdev.svl.ibm.com
/o=ibm/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=VM902142
7383807B
/o=ibm/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=VM902142/cn=Microsoft Private MDB
ecmdev-dc-2.ecmdev.svl.ibm.com
But ServerDN tag only present in autodiscoverxml if outlook client is connected using RPC over HTTP protocol, if outlook client is connected using MAPI over HTTP protocol then ServerDN tag not present in Autodiscoverxml file.
autodiscover xml file snippet for with mapi Http protocol
email
settings
False
False
https://vm935033.ecmdev.svl.ibm.com/mapi/emsmdb/?MailboxId=0f7a9166-e5ed-490a-aed5-21fab4862976@ecmdev.svl.ibm.com
…..
I know some MAPI API like HrGetServerDN which can used, but according to https://blogs.msdn.microsoft.com/dvespa/2015/03/13/hrgetserverdn-fails-with-mapi_e_call_failed-0x80004005/
It is not supported or recommended for any version of Exchange except Exchange 5.5.
I need this property to use it connect to exchange server which is outside of the profile.
Can anyone know any other way for getting ServerDN name using MAPI API or something else ?
Note :- Our Environment is exchange online with outlook client 2016, connected to