Task Sheduler - Permissions
I have created a sheduled task on a windows 2008 server.The task runs a program is a simple exe which creates an excel file as a proof of concept.If I run the program from the command line, as Administrator and/or as an Admin user, the program works fine.If I run the seduled task with "Run only when user is logged on" the program works fine.But i want the task to run even if I am not around so I set the task to "Run whether user is logged on or not" the program seems to attmpt to run but does not have write permissions.I have tried various combinations of "Do not store password" and "Run with highest privileges" to no avail.I have tried to give full control to everyone on the folder and cannot understand what I am doing wrong? Gavin Lilley
February 2nd, 2009 8:50pm

Hi Gavin,Under the properties of the task, there is the option of which user account will be used when running the task. Have you got this set as 'administrator'? Also, could it be that the program you are running needs to interact with the desktop?Ross
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2009 10:03pm

Good evening - Ross,Yes, I have tried the Administrator with correct password as user.I have even created a specific shed.tasks user with specific permissions.The application in question is a dos shell app and when logging the console text to a log the error is specific to my excel object attempoting to write to the disk.I have also tried this suggestion social.technet.microsoft.com but also nothing :-(Is there something i have missed? A security setting maybe? Gavin Lilley
February 2nd, 2009 10:30pm

As a further development, I used a bat script in order to log console activity to a log file on c:The logs are as follows:Errorcreatingexcelfile!!!:TEST02/02/200919:54:28System.Runtime.InteropServices.COMException(0x800A03EC):ExceptionfromHRESULT:0x800A03ECatMicrosoft.Office.Interop.Excel.Workbooks.Open(StringFilename,ObjectUpdateLinks,ObjectReadOnly,ObjectFormat,ObjectPassword,ObjectWriteResPassword,ObjectIgnoreReadOnlyRecommended,ObjectOrigin,ObjectDelimiter,ObjectEditable,ObjectNotify,ObjectConverter,ObjectAddToMru,ObjectLocal,ObjectCorruptLoad)atnld_shipment_report.Program.createExcel(StringstrISPName)Exceptioncaught.FinishedI know that 0x800A03EC is a common excel error which relates to remote security, does this mean I should create a thread in another forum (eg c# or Excel) ??? Gavin Lilley
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2009 10:59pm

Looking around, it would appear that this is a bug afecting Vista and 2008 server.http://bytes.com/topic/c-sharp/answers/819740-c-service-excel-application-workbooks-open-fails-when-called-serviceI have now tested the program and find the issue is the same on the following builds:2008 Server x32 + Office 20032008 Server x32 + Office 20072008 Server x63 + Office 2007Anyone with any ideas? Gavin Lilley
February 2nd, 2009 11:39pm

HiGavin,I couldnt comment on your scenario with Excel but I would suspect an issue with launching the Excelobject under the Admin permissions from scheduled tasks.I do have one suggestion you could try. You could try creating a Service using srvany, which would launch your application simple.exe. This service could run be set to interact with the desktop and be set as startup type manual. You could then use scheduled tasks to launch the service on demand, and terminate on completion.The hope would be that the permissions would be wrapped up by the service.Ross
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2009 2:55am

Good morning - Ross,I see why the service would work, however this wopuld mean a complete rewrite of my established and tested code.The only option I see is to "downgrade" to Server 2003. Gavin Lilley
February 3rd, 2009 10:38am

The casual factor behind this is due ot the DCOM security configuration. http://blog.crowe.co.nz/archive/2006/03/02/589.aspx Gavin Lilley
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2009 12:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics