views:

78

answers:

2

In the past I've used profman2 to create MAPI profiles for servers that need access to Exchange mailboxes when I don't want to install Outlook on a server. This works okay when I'm able to log in as the user who needs access to the profiles. This doesn't work when the application is being run by a service account that has no login rights. How can I programicatlly create the profile either for a different user or at runtime by the service account?

As an aside I use Redemption to access Exchange that requires a MAPI profile already exist. Redemption seems to allow for the creation of MAPI profiles but I can't seem to make this work in C#. Any assistance is appreciated.

A: 

It would be easier to just configure the service to run as someone with rights. We have a dummy Domain user set up with rights for something similar, and it works quite nicely.

Instructions for installing the service to run as another user can be found here: http://www.codeproject.com/KB/cs/DynWinServiceInstallUtil.aspx

David Stratton
I would but all user id's have passwords changed on a regular basis except for 'service' accounts which don't have the ability to logon.
Douglas Anderson
I understand. If it's not an option for you, then I'm hoping you'll find an answer. We ended up making special users with complext passwords that are an exception in that they don't change for specific purposes. Our PCI auditors are OK with this as long as we're limiting access to ONLY what the account needs, and have acomplex enough password. However, if it's not an option for you, this won't help.
David Stratton
+1  A: 

Why not let Redemption create a profile for you?

RDOSession.Logon indeed requires an existing profile, but RDOSession.LogonExchangeMailbox does not - it will create (and delete) a temporary profile.

If you need to access mailboxes owned by a user other than the current one (parent process wise), the rule of thumb is to run your code as the domain user who has access to the mailboxes in question, call LogonExchangeMailbox for the current user, then open the other mailboxes using RDOSession.Stores.GetSharedMailbox.

Dmitry Streblechenko
Thanks Dmitry -- spent a while looking at the documentation and I was under the impression that I needed to create the profile and then use it via .Logon
Douglas Anderson
I get the following error: Error in IMsgServiceAdmin::ConfigureMsgService: MAPI_E_CALL_FAILED -- I'm logged in as a user who has delegated access to the mailbox and, with this user, things did work with the .Logon and I was using this user as a test -- suggestions?
Douglas Anderson