PC Review


Reply
Thread Tools Rate Thread

Avoid Exchange login dialog

 
 
Bernie
Guest
Posts: n/a
 
      2nd Jun 2005
Is there any way to authenticate to an Exchange server without any user
interaction?

The exact situation is as follows:
I have an XP machine with Outlook 2003 that is connected to an Exchange
2003 server, and my program is supposed to enumerate the user's Exchange
folders as well as use the GetSharedDefaultFolder method to access another
user's inbox. The code works fine, except that Outlook requires the user
to enter the Exchange password manually, and I can't for the life of me
figure out how to avoid that. The Save Password checkbox on the dialog has
no effect either.
Both user name and password are known to my application, I just can't
figure out what to do with them.
My current approach is to create a separate thread that looks for login
windows and enters the Exchange password by simulating user input.
However, this is somewhat error-prone and doesn't work at all when the
workstation is locked (I assume it's because the login window can't get
the focus which is required to receive keyboard input).

I'm somewhat of a newbie in this area, so apologies if I'm posting this to
the wrong place. I'll also gladly accept an RTFM-style reply, as long as
it's accompanied by a hint where to find an FM that actually answers my
question (neither Google nor MSDN have proved too helpful on this
particular subject, or maybe I just didn't look in the right place).
Anyways, all help would be *much* appreciated.
 
Reply With Quote
 
 
 
 
Dan Mitchell
Guest
Posts: n/a
 
      2nd Jun 2005
Bernie <bsiATmsiagDOTch> wrote in newsp.srqocxzgqhgd8h@pc-bsi:
> Both user name and password are known to my application, I just can't
> figure out what to do with them.


In that case, you should be able to use LogonUser/ImpersonateLoggedOnUser
to give your thread the identity of that other person. However, that's not
recommended; see

http://blogs.msdn.com/stephen_griffi...13/407925.aspx

for more on that. (note: the MSDN blog server seems particularly flaky
today, but that link should work given a bit of persistence)

-- dan
 
Reply With Quote
 
Bernie
Guest
Posts: n/a
 
      2nd Jun 2005
Thank you, but that's not exactly what I'm looking for. The Exchange login
is different from the Windows login, in fact the client and the server
aren't even on the same domain. Hence, I don't think there's any way to
avoid explicitly passing the username/password combination to the Exchange
server via Outlook.

Still, thanks for your time :-)



>> Both user name and password are known to my application, I just can't
>> figure out what to do with them.

>
> In that case, you should be able to use
> LogonUser/ImpersonateLoggedOnUser
> to give your thread the identity of that other person. However, that's
> not
> recommended; see
>
> http://blogs.msdn.com/stephen_griffi...13/407925.aspx
> for more on that.

 
Reply With Quote
 
Dan Mitchell
Guest
Posts: n/a
 
      2nd Jun 2005
Bernie <bsiATmsiagDOTch> wrote in newsp.srq1v5qrqhgd8h@pc-bsi:
> Thank you, but that's not exactly what I'm looking for. The Exchange
> login is different from the Windows login, in fact the client and the
> server aren't even on the same domain.


Oh, I see. Maybe this is one of the cases where the profilePassword
argument to CDO1.21's Session.Logon() / lpszPassword to MAPILogonEx would
be useful -- it would certainly be worth a try, at least.

-- dan

 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      2nd Jun 2005
No, that password is only used by the PST provider.
There is no way to bypass the login dialog if the current user and Exchange
are on different domains with no trust, at least not when using the Outlook
Object Model.
You can use LogonUser/ImpersonateLoggedOnUser in case of CDO 1.21 or
Extended MAPI, but that won't work with OOM as it runs in a separate process
space (outlook.exe), not in-proc. Plus it needs to see the profile to be
able to log in; and the profiles are stored on a per Windows user basis.

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

"Dan Mitchell" <(E-Mail Removed)> wrote in message
news:Xns966974CFB4ABDdjmitchellayahoocom@207.46.248.16...
> Bernie <bsiATmsiagDOTch> wrote in newsp.srq1v5qrqhgd8h@pc-bsi:
>> Thank you, but that's not exactly what I'm looking for. The Exchange
>> login is different from the Windows login, in fact the client and the
>> server aren't even on the same domain.

>
> Oh, I see. Maybe this is one of the cases where the profilePassword
> argument to CDO1.21's Session.Logon() / lpszPassword to MAPILogonEx would
> be useful -- it would certainly be worth a try, at least.
>
> -- dan
>



 
Reply With Quote
 
Dan Mitchell
Guest
Posts: n/a
 
      2nd Jun 2005
"Dmitry Streblechenko" <(E-Mail Removed)> wrote in
news:#3hpW#(E-Mail Removed):
> No, that password is only used by the PST provider.


Oh, right, now I remember. Sorry, I was confused there.

> You can use LogonUser/ImpersonateLoggedOnUser in case of CDO 1.21 or
> Extended MAPI, but that won't work with OOM as it runs in a separate
> process space (outlook.exe), not in-proc. Plus it needs to see the
> profile to be able to log in; and the profiles are stored on a per
> Windows user basis.


That's the sort of nasty stuff that Steve Griffin's blog entry is talking
about.. Somewhere I have a post saved away by a guy who does all sorts of
grim things copying tokens around and tweaking ACLs on bits of the
registry, which seems like more trouble than it's worth.

-- dan
 
Reply With Quote
 
Bernie
Guest
Posts: n/a
 
      3rd Jun 2005
Oh dear. I start to think there simply is no way to do what I want. Well,
thanks for your time anyway! I guess it's time to try some less
recommended approaches.

- Off to play with DLL injection




>> No, that password is only used by the PST provider.

>
> Oh, right, now I remember. Sorry, I was confused there.
>
>> You can use LogonUser/ImpersonateLoggedOnUser in case of CDO 1.21 or
>> Extended MAPI, but that won't work with OOM as it runs in a separate
>> process space (outlook.exe), not in-proc. Plus it needs to see the
>> profile to be able to log in; and the profiles are stored on a per
>> Windows user basis.

>
> That's the sort of nasty stuff that Steve Griffin's blog entry is
> talking
> about.. Somewhere I have a post saved away by a guy who does all sortsof
> grim things copying tokens around and tweaking ACLs on bits of the
> registry, which seems like more trouble than it's worth.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to avoid sql login dialog box to run access query Jack Microsoft Access VBA Modules 1 31st Dec 2008 12:08 AM
How to avoid warning pop-up dialog boxes Andrew Microsoft Excel Programming 3 23rd May 2008 08:56 PM
Avoid login dialog sshock@gmail.com Microsoft Outlook VBA Programming 1 26th Sep 2006 05:47 PM
How to avoid an error dialog =?Utf-8?B?anVzdGFndXlmcm9ta3k=?= Microsoft Excel Programming 2 18th Feb 2006 10:02 PM
Any way to get rid of an auto-suggestion in the login dialog box, for Exchange/OL using RPC over HTTP? Lanwench [MVP - Exchange] Microsoft Outlook 4 5th Jan 2006 02:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:36 PM.