Allowing users to start and stop SQL Server Agent Jobs

Start/StopI recently received a request to allow certain users to start and stop SQL Server Agent jobs, without giving them the ability to use the SQL Server Agent tools in SQL Server Management Studio.

I created a Visual Studio .Net application that provides that ability through stored procedures that use the WITH EXECUTE AS OWNER directive.

The T-SQL code for the SQL Server prerequisites for this app are as follows:

You’ll need to create user principals in the msdb object, and add them to the agent_job_control database role. Once that is completed those users can start and stop jobs, and obtain the status and recent history of jobs, by specifying the job_id uniqueidentifier.

Project Code is here: SQLServerJobControl