Hi all, I have developed a simple C# Console application. In the connection string I am using a named SQL Server Login, so not Windows Auth and the application works fine and I can connect to the database.
I set this up to run as a scheduled task, and it runs when the Task is set up to use my Username/Password with no problems.
I created a new user specifically to run this (good practise to not have it running as me obviously), added them to the Administrators group of the machine, and configured the Task to use this new user.
When the task runs using the new user, the code fails with the following error on each of the attempts to access the database.
'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)'
Which is your standard SQL Server Access Denied error. I also tried configuring the task to run as the NT AUTHORITY\SYSTEM user and get the same problem. I used SQL Profiler to ensure the user coming through was the one named in the connection string and that is fine.
To double check it is related to the user, I logged into the machine as the new user and tried running from the command line and I get the same error.
Any ideas? Thanks in advance.