Cannot run scheduled task without assigning administrator rights or logged in

Add-in Express™ Support Service
That's what is more important than anything else

Cannot run scheduled task without assigning administrator rights or logged in
How to run batch scheduled task job with minimal privileges 
Kenny




Posts: 3
Joined: 2013-02-08
Hi,

I have a service account that has an outlook email account(domain\service_account) that is used to manage a set of distribution lists. A nightly job written in VB6 reads thru all of those dist lists and loads them into SQL. The problem is that I cannot get the scheduled task to run without that service account being a member of the administrators group, or being logged in interactively. It appears to hang at SecurityManager.ConnectTo objApp. Being a member of the Power Users group doesn't work either. Do you have to load the service accounts profile or how else can I work around this issue? We cannot have a service account run with admin rights and having an email account.

Security Manager 2010 for MS Outlook Activex Edition V6.1 1029
Windows 2003 Standard R2 SP2 English
VB6 SP5

Let me know if to make this work without being an administrator and without being logged on interactively.

Thank you!
Posted 06 Mar, 2013 08:22:59 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Kenny,

After reading your post for the second time, I've come to remember that accessing the Outlook object model in a task run via scheduler isn't recommended or supported by Microsoft as explained at http://support.microsoft.com/kb/257757.

Can you please check if the interactive user (the one currently logged to Windows) is mentioned in the User Name column for your task, see the Processes tab in the Task Manager window?


Andrei Smolin
Add-in Express Team Leader
Posted 06 Mar, 2013 10:03:07 Top
Kenny




Posts: 3
Joined: 2013-02-08
Hi Andrei,

I am logged on with my account. In Scheduled Tasks, I've set the job to run under the service account so when it kicks off, Task Manager shows the service account userid. Funny, if I open the console in a different window with the service account and then execute the scheduled task from my window, it launches on the console window session. I tried loading the ntuser.dat profile of the service account but get RegLoadKey: 1314.

Based on what you've uncovered in the KB article, I am thinking there must be some other product I can use to pull contacts from Exchange and stuff them in a sql table. Or put a front-end on my most recently loaded SQL table for users to manage...they just wouldn't have the convenience of selecting members from our company address book. It would eliminate a business case for managing a service account with an email account though. But it's kind of nice, since the security model and everything is there in the Outlook contact dist lists for our users to manage. And there are a few dozen dist lists with a dozen or more members in each dist list.

Let me know if you have any suggestions. Thanks, Kenny
Posted 06 Mar, 2013 14:55:41 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hi Kenny,

I've understood what's going on. Well, I believe I understood. In order to start working, Outlook Security Manager needs to have an Outlook window but there's no Outlook window if the user isn't logged in. And this is why it stops when you call ConnectTo objApp.

Kenny writes:
I am thinking there must be some other product I can use to pull contacts from Exchange


I don't know if such a product exists.


Andrei Smolin
Add-in Express Team Leader
Posted 07 Mar, 2013 03:02:07 Top
Kenny




Posts: 3
Joined: 2013-02-08
Hi Anrei,

Thanks so much for your help. One more question. The scheduled task works fine when the service account is in the administrators group. Do you know if there are a particular set of local policies that would be just enough for this to work somehow without being an admin?

Cheers,
Kenny
Posted 07 Mar, 2013 07:51:19 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
I'm sorry, I have no idea.


Andrei Smolin
Add-in Express Team Leader
Posted 11 Mar, 2013 10:59:52 Top