You have to use tsql to do that.
in the job step after your main job step add 2 more job steps:
step 2--success email
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'YOUR MAIL PROFILE',
@recipients = 'COMPANYMAIL@COMPANY.COM',
@body = 'Copy and Purge BAKs success !!',
@subject = 'Copy and Purge BAKs success',
-- to send file attachments
@file_attachments = 'D:\logs\log.TXT',
-- Change below if you want to include query results from a table in the email.
-- Note that below is not in HTML
@query = 'select column1, column2 from table1';
step 3-- failure email
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'YOUR MAIL PROFILE',
@recipients = 'COMPANYMAIL@COMPANY.COM',
@body = 'Copy and Purge BAKs failed !!',
@subject = 'Copy and Purge BAKs failed',
-- to send file attachments
@file_attachments = 'D:\logs\log.TXT',
-- Change below if you want to include query results from a table in the email.
-- Note that below is not in HTML
@query = 'select column1, column2 from table1';
and then use tsql sp_send_dbmail
Note: If you want HTML email to be send out, I have a script for that to help you out.
After some reading I think I got it.
"NT SERVICE\SQLSERVERAGENT" is a member of the local group "SQLServerSQLAgentUser$RINUS$MSSQLSERVER".
This group has al the right that a sql server agent account needs
"NT SERVICE\SQLSERVERAGENT" is a part of the sql server fixed sysadmin role
"NT SERVICE\SQLSERVERAGENT" can't be selected in the list of available built-in accounts, local accounts or domain accounts. This is because they are services, not accounts. They have a security identifier (SID) in Windows, but Windows knows they aren't real users. Windows can authenticate them, but they don't have passwords that any human can use. If you run lusrmgr.msc and look at the groups, you will see groups like SQLServerMSSQLUser$computername$MSSQLSERVER and NT SERVICE\MSSQLSERVER is a member of the group.
The dedicated account that I have created for the agent is set for the windows service
If you connect the dots you will get a chain that explains this. The part thats new for me is that the NT SERVICE\SQLSERVERAGENT can represent the dedicated agent account.
Sources :
Best Answer
(1) is referring to the service itself. If I go stop the SQL Server Agent service this value specifies how long it will wait for any active job to complete before forcible stopping it (the service) so it can shutdown.
With regards to (2) and (3), you would have to setup some monitoring script/job that tracks that information and performs an action based on your criteria.