Re: MAPI_E_LOGON_FAILED when running two MAPI clients as different users



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

  • MAPI_E_LOGON_FAILED when running two MAPI clients as different users
    ... MAPI client running on the machine. ... MAPI client (such as Outlook) running, but only if that client is ... running under the same domain account. ... I don't have Exchange Server installed on my development machine. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Ent/Exch: Scheduling shows others free/busy, but not mine
    ... are on different Exchange servers? ... can you try viewing the same problem via Outlook on a Windows ... mecklists-DB1076.23414513022007@xxxxxxxxxxxxxxxxxxxx, "William Smith" ... If I create a new event and invite others to it, the "scheduling" area ...
    (microsoft.public.mac.office.entourage)
  • Re: Outlook installed on Exchange server ... What to do now???
    ... Upgrade your Version of Veritas backup Exec - version 8.6 ... Outlook should not ever be installed on Mail servers ... (mind you i wont install it on ANY server myself) ... >> Outlook on Exchange servers. ...
    (microsoft.public.exchange2000.admin)
  • Re: My Annual Linux Adventure
    ... >> do respect the platforms. ... The kicker for me, and most of the client groups, is the use of Outlook ... with the Exchange servers - almost every one of them needs the Calendar, ... delegated calendar, tasks, delegated tasks, and some need to share their ...
    (alt.os.linux.redhat)
  • Re: Outlook does not reload data in forms in public folders
    ... How many Exchange Servers do you have eg if you have multiple instances of ... Also are you using Outlook in Cached mode if so try switching to online ... I've made a costumized form, which resides in a public folder. ...
    (microsoft.public.exchange2000.development)

Quantcast