SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Run a SQL Server Agent job under another account


Run a SQL Server Agent job under another account

Author
Message
gerald.britton
gerald.britton
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 5
ON my server, SQL Server Agent runs under the NT AUTHORITY\NETWORK SERVICE account. That's usually just fine and I don't want to change it. However, it means that jobs running under the agent cannot access LAN shares. That's what I would like to do in a new job. I figured I could just use an account that I know has access to the share. What I can't figure out is how to do that. I read some MS doc on setting up proxies, but I can't figure out how to make that work.

Has anyone done what I'm trying to do? If so, can you give a step-by-step to do it?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27791 Visits: 13268
First you need to create a credential.
This will typically map to a domain account.

Next you create a proxy account and you link this to the credential you just created.
You also need to specify a subsystem for which the proxy will be active. For example: if you want the proxy to execute SSIS packages in a job step, you add the SSIS subsystem.

Finally, when you create a job step, you can specify the proxy account from the Run As dropdown.
This job step will now run under the credentials of the proxy account.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
gerald.britton
gerald.britton
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 5
Koen Verbeeck (7/4/2013)
First you need to create a credential.
This will typically map to a domain account.


OK -- did that, no problem!

Koen Verbeeck (7/4/2013)
Next you create a proxy account and you link this to the credential you just created.
.


Here's where I ran into trouble. I started to create the proxy, and added my just-created credential as a principal. Then I saved the definition. However, I reopened the proxy definition to check my work and the principal I had just added (using the new credential) was gone! No error messages, no pop-ups, no nothing....just gone, baby, gone. Since I thought I was nuts, I did it several more times but always with the same results (I guess I am nuts -- I think that's one of the definitions!)

Why didn't it save the principal and why didn't it tell me it there was a problem? What can cause this and how do I fix it?

Koen Verbeeck (7/4/2013)
You also need to specify a subsystem for which the proxy will be active. For example: if you want the proxy to execute SSIS packages in a job step, you add the SSIS subsystem.
.


In my case I'm only going to do shell commands using xp_cmdshell

Koen Verbeeck (7/4/2013)
Finally, when you create a job step, you can specify the proxy account from the Run As dropdown.
This job step will now run under the credentials of the proxy account.


I set that up, but can't use it because of the "principal" problem. What should I do?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27791 Visits: 13268
You don't need to add the credential as a principal.
You need to specify the credential in the credential name box.

See the screenshot in attachment.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Attachments
proxy.jpg (59 views, 98.00 KB)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search