By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,358 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,358 IT Pros & Developers. It's quick & easy.

MAPI Logon error in .Net Windows service

P: n/a
I've written a Windows service in VB.Net that accesses the global address
list to obtain all the entries to store them in a local database. The GAL is
accessed using the MS Exchange profile on the current machine. The service
then creates a new MAPI session and then attempts to log on to the session
using the current MS Exchange profile on the machine. Here is the section of
code that is erroring:

Dim oSession As MAPI.Session
oSession = CreateObject("MAPI.Session")
oSession.Logon(sProfile)

sProfile is a string containing the profile name that was obtained from the
registry.

As soon as the service hits the logon line it errors giving the following
error:

[Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]

An MSDN article suggested trying to create a new profile at the logon line
but that produces the following error:

[Collaboration Data Objects - [UNKNOWN_ERROR(80010106)]]

I have tried various things such as getting the service to log on as
somebody else, I have local admin rights and domain admin rights.

Has anyone had problems using MAPI with a windows service before? I have
the same code as a windows application and it works fine.

Any help would be appreciated.
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.