I have a simple executable to run as a scheduled task on some Windows Server 2008 R2. The executable downloads a file from a couple of locations, then writes the time to download the files to a SQL database.
The problem I am having is that when I run the EXE using my account, it works absolutely fine.
When I run it as an account set up specially for use with this scheduled task the task fails. It manages to download the files ok, but fails when trying to write to the database. The user used to write to the database is hard coded within the EXE.
My account is a Domain Admin, whereas the account to run the task as is not. I am trying to figure out which of the Security Settings in Group or Local Policy might be missing, or if their is something else.
The EXE throws an error message:
System.ArguementOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index
This is also logged in the Appication Windows log as an Unhandled Exception for the .Net app.
Both the developer and I suspect this is related to the Security Settings on the server. The account in question is already added to the Allow log on locally and Log on as a batch job. There are SO many options, millions of permutations, that it will take ages to figure out what is correct.
If I set the account as a Domain Admin then it works, but I don't like just setting things to the equivalent of root rather than figuring out the appropriate security level.
Does anyone recognise this specific issue, or have any pointers for how to figure out which security settings need changing?