0

I have a command line program (that I wrote) that I can run on Windows Server 2012. It connects to the MS SQL Database server on a different server which has a linked server to a Access database. It works fine when I just run this program from the command prompt.

However when this program is run using a scheduled task I get an error "The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "BackOffice" reported an error. Authentication failed."

The scheduled task is set to run under my login, the same login as I run the program at the command prompt, I have tried with "Run with highest privileges" turned off and turned on, but neither works.

Paul
  • 111
  • 1

2 Answers2

1

Sorry I made a mistake, I have since realized the problem is because the connection string was using a SQL server username and password and I needed to change it to integrated security so it used the windows login.

Everything is ok now.

Paul
  • 111
  • 1
0

Might be a double-hop Issue. Have a look at this or at this question very similar to yours.

In this case he was able to resolve the issue by alterin CredSSP delegation like so:

On the Task Server: Enable-WSManCredSSP Client –DelegateComputer <schedTaskHost>

On the SQL Server: Enable-WSManCredSSP Server

If this doesn't help: Check with SQL Server Profiler for errors by setting Show all events, extend Errors and Warnings and enable User Error Message let it run and try your connection again. Read the red entries.

Manu
  • 704
  • 2
  • 19