Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Run a SQL Server Agent job under another account Expand / Collapse
Author
Message
Posted Thursday, July 4, 2013 11:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 10, 2013 1:45 PM
Points: 3, 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?
Post #1470489
Posted Thursday, July 4, 2013 2:50 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:47 AM
Points: 13,644, Visits: 10,537
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1470511
Posted Friday, July 5, 2013 7:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 10, 2013 1:45 PM
Points: 3, 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?
Post #1470728
Posted Friday, July 5, 2013 7:31 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:47 AM
Points: 13,644, Visits: 10,537
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence


  Post Attachments 
proxy.jpg (13 views, 98.62 KB)
Post #1470732
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse