In this article, we will discuss about using Proxy Accounts in SQL Server Agent jobs. We will talk about what this feature offers and how you can use it.
Why Using Proxy Accounts in SQL Server Agent Jobs?
When using SQL Server, in many cases you will might need to set up a SQL Server Agent job that will be accessing a resource within the domain.
For example, you want to include a step in a SQL Server Agent job that based on some logic, will be handling a Windows service on a server within the domain by using the Operating System (CmdExec) SQL Server subsystem.
In order for the job to be successfully executed, the specific job’s execution context should be allowed access to the target resource in the domain.
If you are using a domain user as a service account for the SQL Server Agent in the specific instance, you can assign the necessary access rights to that user account.
However, there is also another way which I personally prefer; using a Proxy Account for executing the specific job step 🙂
In order to be able to do this you must perform the following actions within the instance of SQL Server:
- Create a credential
- Create a Proxy Account that uses the credential you created in the first step
For creating a credential, in SSMS you navigate to: Security — Credentials
You can then create the credential by providing an identity (i.e. a domain user) along with its password.
For creating a Proxy Account, in SSMS you navigate to: SQL Server Agent — Proxies
You can then create a new Proxy Account by giving it a name and performing the following:
– Provide the credential you earlier created
– Enter a description (optional)
– Set the subsystems for which the Proxy Account will be active. These are:
——- ActiveX Script
——- Operating system (CmdExec)
——- Replication Distributor
——- Replication Merge
——- Replication Queue Reader
——- Replication Snapshot
——- Replication Transaction-Log Reader
——- SQL Server Analysis Services Command
——- SQL Server Analysis Services Query
——- SQL Server Integration Services Package
Creating the SQL Server Agent job
That’s it! You can now proceed and set up the SQL Server Agent job along with its steps, and in the step you want to use the Proxy Account you select it in the “Run as” drop down box.
Whenever the specific job step runs, it will be executed in the context of the provided Proxy Account.
* Note that in order to be able to use a Proxy Account in a specific job step, the Proxy Account needs to be activated for the specific subsystem (i.e. Operating system – CmdExec).
Strengthen your SQL Server Administration Skills – Enroll to our Online Course!
If you really want to learn sophisticated SQL Server administration techniques, then you should check our on-demand online course titled “Essential SQL Server Administration Tips” (special limited-time discount included in link).
Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!
Featured Online Courses:
- Introduction to Azure SQL Database for Beginners
- Working with Python on Windows and SQL Server Databases
- Introduction to Azure Database for MySQL
- Boost SQL Server Database Performance with In-Memory OLTP
- Essential SQL Server Administration Tips
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Development Tips for SQL Developers
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- SQL Server 2019: What’s New – New and Enhanced Features
- Entity Framework: Getting Started – Complete Beginners Guide
- Data Management for Beginners – Main Principles
- A Guide on How to Start and Monetize a Successful Blog
Related SQL Server Administration Articles:
- Essential SQL Sever Administration Tips
- How to Patch a Standalone SQL Server Instance
- The SQL Server Browser Service and UDP Port 1434
- The Maximum Number of Concurrent Connections Setting in SQL Server
- Top 10 SQL Server DBA Daily Tasks List
- There is no SQL Server Failover Cluster Available to Join
- Encrypting a SQL Server Database Backup
- …more
Rate this article:
Reference: SQLNetHub.com (https://www.sqlnethub.com)
© SQLNetHub
Artemakis Artemiou is a seasoned Senior Database and AI/Automation Architect with over 20 years of expertise in the IT industry. As a Certified Database, Cloud, and AI professional, he has been recognized as a thought leader, earning the prestigious Microsoft Data Platform MVP title for nine consecutive years (2009-2018). Driven by a passion for simplifying complex topics, Artemakis shares his expertise through articles, online courses, and speaking engagements. He empowers professionals around the globe to excel in Databases, Cloud, AI, Automation, and Software Development. Committed to innovation and education, Artemakis strives to make technology accessible and impactful for everyone.