Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Impersonate user on logon with redemption (http://www.outlookbanter.com/outlook-vba/55153-impersonate-user-logon-redemption.html)

Safal August 21st 07 05:22 AM

Impersonate user on logon with redemption
 
Is it possible to impersonate another user(say the administrator) using the
redemption logon

Is the syntax below correct ?

set Session = CreateObject("Redemption.RDOSession")
Session.Logon '"Admin","Admin",false,true

Also do we specify the NT logon credentials or the "User Name" as per the
exchange server.

-Safal

Dmitry Streblechenko August 21st 07 06:17 PM

Impersonate user on logon with redemption
 
You can impersonate another user using the Windows API (LogonUser /
ImpersonateLoggedOnUser) first, but MAPI does not work too well with
impersonation.
RDOSession.Logon takes the name of the existing profile, *not* a user name.
If you need to connect to a particular user's mailbox, use
RDOSession.LogonExchangeMailbox; it takes the user name and the Exchange
Servere name.

As a rule of thumb, if you need to access multiple mailboxes, run your code
under the user identity of the admin (or a user who can access the required
mailboxes), call RDOSession.LogonExchangeMailbox specifying the name of that
user, then open other users mailboxes using
RDOSession.Stores.GetSharedMailbox.

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

"Safal" wrote in message
...
Is it possible to impersonate another user(say the administrator) using
the
redemption logon

Is the syntax below correct ?

set Session = CreateObject("Redemption.RDOSession")
Session.Logon '"Admin","Admin",false,true

Also do we specify the NT logon credentials or the "User Name" as per the
exchange server.

-Safal




Dan Mitchell August 21st 07 10:14 PM

Impersonate user on logon with redemption
 
"Dmitry Streblechenko" wrote in
:
You can impersonate another user using the Windows API (LogonUser /
ImpersonateLoggedOnUser) first, but MAPI does not work too well with
impersonation.


http://blogs.msdn.com/stephen_griffi...13/407925.aspx has
more details on what exactly doesn't work -- to quote from the "Getting
MAPI to work with impersonation is very hard. If you have an application
which uses MAPI with impersonation and you're not experiencing problems,
congratulations."

-- dan


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com