Auditing SQL Agent job creation and deletion

SQL Agent jobs are added / removed using stored procedure interface sp_add_job and sp_delete_job. Customers have asked us how we could track user who has created a job / deleted a specific job. You could accomplish this using SQL Server Auditing feature. You can turn on Auditing to track and log stored procedure execution requests…

0

Starting Jobs in Powershell using Job Name

http://blogs.msdn.com/b/sqlagent/archive/2010/12/29/starting-jobs-in-powershell-using-job-name.aspx  This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm

0

Scheduled Policy Evaluation on multiple servers using MSX/ TSX in SQL Agent

One of our customer was looking for ways to schedule a policy evaluation on multiple servers using their existing MSX/TSX infrastructure.  I thought it would be better to blog an article that could help others looking for similar information http://blogs.msdn.com/b/sqlagent/archive/2010/11/19/scheduled-policy-evaluation-on-multiple-servers-using-msx-tsx-in-sql-agent.aspx  This posting is provided “AS IS” with no warranties, and confers no rights. Use of included…

0

Turning on Verbose logging in SQL Agent

Turning on Verbose logging in SQL Agent  This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm

0

Create a database backup job using SQL Server Management Studio

SQL Server Management Studio  can be used to create a database backup job to backup an user database. Link        This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm

1

Create SQL Agent job using SMO

# Powershell script to create a new Agent job and list the job using JobCollection # Inspects error collection and prints all inner exceptionfunction CheckForErrors{        $errorsReported = $False         if($Error.Count -ne 0)        {                write-host “******************************”                write-host “Errors:”, $Error.Count                 write-host “******************************”                foreach($err in $Error)                {                        $errorsReported  = $True                        if( $err.Exception.InnerException -ne $null)                        {                                write-host $err.Exception.InnerException.ToString()                        }                        else                        {                                write-host $err.Exception.ToString()                        }                        write-host “———————————————-”                }                throw        }} # Create a new job and get job back from…

1