// Code summary
...
MAPIInitialize(&mapicfg);
...
MAPIAdminProfiles(0, &pa);
...
mapi_tmpprofile = GenUniqueProfName();
...
pa->CreateProfile(mapi_tmpprofile, NULL, 0, 0)
...
pa->AdminServices(mapi_tmpprofile, NULL, 0, 0, &sa)
...
sa->CreateMsgService(_T("MSEMS"), _T("Microsoft Exchange"), 0, 0)
...
HrQueryAllRows(msg_svcs_tbl, (LPSPropTagArray)&svc_props, &res, NULL,
0, &msg_svcs)
...
hr = sa->ConfigureMsgService((LPMAPIUID) msg_svcs->aRow-
>lpProps[ SVC_PROP_UID ].Value.bin.lpb, 0, NULL, 2, cfg);
...
hr = MAPILogonEx(0L, mapi_tmpprofile, NULL, MAPI_EXTENDED |
MAPI_NEW_SESSION | MAPI_NO_MAIL, &mapi_session);
...
mapi_session->GetMsgStoresTable(0, &tbl_stores)
...
HrQueryAllRows(tbl_stores, (LPSPropTagArray)(&props), NULL, NULL, 0,
&rs_stores);
...
hr = mapi_session->OpenMsgStore(NULL, eid->cb, (LPENTRYID)(eid->lpb),
NULL, MAPI_BEST_ACCESS | MDB_NO_DIALOG | MDB_NO_MAIL, &mapi_mdb); //
fails here
...
pa->DeleteProfile(mapi_tmpprofile);
...
My code is running in a COM+ application in the Exchange Server 2007
server with the Identity of the user who owns the Mailbox "myadmin"
And "myadmin" is a member of the following groups:
-Local Administrator
-Domain User
-Exchange Organization Administrator
-Exchange View-Only Administrator
-Exchange Server Administrator
It also has the following rights:
-Logon Locally
-Logon as a batch
-Logon as a service
This works fine on Exchange 2003 and it does in some configurations of
Exchange 2007. But it is failing when using a Client Access Servers -
Mailbox Servers configuration.
Any clue why? Is there any new issue with CDO I am not aware of?
Please anything you can suggest...
Thanks in advance for looking at this.
Pkatz
> I have the following problem. My code fails calling mapi_session-
>> OpenMsgStore(...) with error: 0x8004011D (I think it is
>> MAPI_E_FAILONEPROVIDER).
That might be because of the new PF flag. See here:
http://blogs.msdn.com/stephen_griffin/archive/2007/03/19/mapi-and-exchange-2007.aspx
and
--
SvenC
Thank you very much!!!
-pkatz