Re: MAPI_E_LOGON_FAILED when running two MAPI clients as different users



AFAIK Exchange provider stores global connection data in a shared memory
(memory mapped file).
How do you call MAPILogonEx?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jon Goldberg" <jong@xxxxxxxxxxxxx> wrote in message
news:eQafh9hNFHA.2356@xxxxxxxxxxxxxxxxxxxxxxx
> In my test cases, both accounts are in the same domain.
>
> Do you have any details about the problem with simultaneous connections to
> Exchange Servers in different domains? I'm sure that scenario will come
> up in some deployments.
>
> But right now I'm testing with both accounts in the same domain, and both
> connecting the the same Exchange 5.5 server.
>
> thanks,
> Jon
>
> Dmitry Streblechenko wrote:
>
>> Exchange provider has problems with simultaneous MAPI sessions connected
>> to Exchange Servers in different domains.
>> Do both user accouns come from the same domain and connect to the same
>> server?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Jon Goldberg" <jong@xxxxxxxxxxxxx> wrote in message
>> news:uBWucbgNFHA.688@xxxxxxxxxxxxxxxxxxxxxxx
>>
>>>Hi-
>>>
>>>I have a program that impersonates a domain account and connects to an
>>>Exchange Server mailbox. The code works great when it is the only
>>>MAPI client running on the machine. It also works if I have another
>>>MAPI client (such as Outlook) running, but only if that client is
>>>running under the same domain account. As soon as I run Outlook under
>>>a different account, or run a second instance of my own program
>>>running under another account, I get MAPI_E_LOGON_FAILED errors.
>>>
>>>There seems to be some problem running simultaneous MAPI client
>>>programs on the same machine under different accounts.
>>>
>>>Does anyone know how to have two concurrent threads use MAPI as
>>>different users?
>>>
>>>Here are some details on my code:
>>>
>>>First, I impersonate the domain account:
>>>
>>>1. LogonUser as the domain account
>>>2. LoadUserProfile as the newly logged-on user
>>>3. GetUserProfileDirectory to verify the profile is loaded
>>>4. ImpersonateLoggedOnUser to run under the new security context. I
>>> verify that the SECURITY_IMPERSONATION_LEVEL is
>>> SecurityImpersonation at this point, and that GetUserName returns
>>> the name of the domain account
>>>
>>>Next, I dynamically create a MAPI profile to connect to the
>>>mailbox owned by that account:
>>>
>>>1. MAPIInitialize as NT_SERVICE
>>>2. GetProfileTable to see if my profile already exists. If not:
>>> a. CreateProfile
>>> b. CreateMsgService to add MSEMS to the profile
>>> c. Query the service table to get the handle to the MSEMS service
>>> d. ConfigureMsgService: FAILS if Outlook or some other MAPI
>>> client is running as some other user. SUCCEEDS if no one
>>> else is running.
>>>3. MAPILogonEx
>>>4. GetMsgStoresTable to find the default store
>>>5. OpenMsgStore: FAILS if Outlook or some other MAPI client is running
>>> as some other user. SUCCEEDS if no one else is running.
>>>
>>>My versions are:
>>>OS: Windows 2000, SP4.
>>>Outlook: 2002 (10.2627.3501) SP-1 installed.
>>>Exchange Administrator 5.5 (2650.24) client, SP 3 installed.
>>>
>>>I don't have Exchange Server installed on my development machine. I
>>>am connecting to a remote Exchange 5.5 machine.
>>>
>>>thanks for any help,
>>> Jon
>>
>>

.



Relevant Pages

  • Re: rename AD user account creates problem with autocomplete in Ou
    ... I'm a very inexperienced Exchange Server administrator, ... You can rename an account in the active directory and it will need to ... >> problem in the autocomplete feature of the client Outlook 2003. ...
    (microsoft.public.exchange.admin)
  • Re: Outlook 2003 and XP SP2
    ... Milly Staples [MVP - Outlook] ... account will be deleted without reading. ... || Vote for your favorite Outlook and Exchange utilities in the ... to the profile, ...
    (microsoft.public.office.setup)
  • Re: SBS 2003 email advice
    ... If you send mail through Outlook using the exchange account and its bound for a .local address it just moves around inside Exchange. ... I need SBS clients running Outlook XP to be able to receive mail from their ...
    (microsoft.public.backoffice.smallbiz)
  • Re: Outlook 2003 and XP SP2
    ... profile, ... You can only have one exchange account ... Diane Poremsky [MVP - Outlook] ... Outlook & Exchange Solutions Center: http://www.slipstick.com ...
    (microsoft.public.office.setup)
  • Re: Outlook 2003 and XP SP2
    ... > a new profile using Exchange without first ... > Outlook 2003 with this user account on this machine) I get this error: ... Diane Poremsky [MVP - Outlook] ...
    (microsoft.public.office.setup)

Loading