question

ra580 avatar image
ra580 asked

SQLContext.WindowsIdentity shows NT Authority/Network Security

I have a scheduled job executes which executes a Stored Procedure, the SP then in turn call another SP which calls a .Net DLL method. I need SQLContext.WindowsIdentity in the DLL code in order to implement User Impersonation. I need the impersonation since only a specific user has access on a shared network directory which I intend to read.

The problem is that the scheduled job executes under NT Authority/Network Security and I get this Name in SQLContext.WindowsIdentity, while I need my specific user here. For that I have added this user as Owner of the Job as well as specified in the Job Step.

Any leads would be helpful.

sql-server-2005sql-agent
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
tomgough79 avatar image
tomgough79 answered
You could create a credential using the login name that can access the directory, then use that to create an agent proxy under which the job can be run
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.