Friday, April 4, 2008

MapiExceptionLogonFailed: Unable to make connection to the server. (hr=0x80040111, ec=1010)

OK, when i first hit this, It was really random in nature. At times on and off and then i saw a pattern with this: It would happen with alternate runs or attempts.. The main cause of this ( Esp if you see LIDs like this:
Lid: 23065 EcDoConnectEx called [length=162]
Lid: 17913 EcDoConnectEx returned [ec=0x3F2][length=56][latency=34]
Lid: 56945
Lid: 23065 EcDoConnectEx called [length=162]
Lid: 17913 EcDoConnectEx returned [ec=0x3F2][length=56][latency=3] ) Is that internally Microsoft Exchange Store is caching the information about various attributes of your mailbox e.g. login information or your mailbox database and by repeatedly re-creating and deleting the user time and again you are increasing the probability of hitting it. This might be just one of the reasons why we hit this exception but it certainly fixed my code. So if possible, try creating users only in the beginning and then use them throughout or create them with random names. Restarting MS Exchange IS ( Information store ) might also help.