2
votes

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.

2

2 Answers

4
votes

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.

0
votes

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