Click to See Complete Forum and Search --> : MAPI email sync run from NT 'AT' command


Rohan
February 8th, 2000, 05:29 PM
I have some code which using MAPISession, simply logs into an exchange server using a Profile ( Name set in the MAPISession Control), and using NT Password Authentication (Set in the profile). This works fine when run by the user currently logged into the NT PC, But a requirement is that it runs as a schedule using NT's AT command which runs all schedules under the "system" user context. The email sync then fails because the "system" user has no mailbox on the exchange server. I think that once the schedule starts the app as "system" I then need to execute the remaining code under the logged in users context.

Can anyone Please give any suggestions on how to do this ?

Lothar Haensler
February 9th, 2000, 01:52 AM
the Platform SDK has quite a few APIs for creating a process in the context of the logged on user.
checkout CreateProcessAsUser for example.

Rohan
February 29th, 2000, 10:15 PM
Thanks for you help,

I've used CreateProcessAsUser to succesfully run the email sync using the NT AT command.

But, my next hurdle is to syncronise the email using the 'AT' command when the PC is turned on but no user is logged on. When I try this the process is created, but seems to hang when it attempts to connect to Exchange.

Could this be that the process doesnt have the same level of authentication as a normal logon ?