April 23, 2015 at 10:53 am
Hi there..
i have 70 SQL database servers and i setup DB Mail on the 70 Servers, i want to know is there a way to find the status of all the jobs which i assigned the DB Mail and if its working/failing... is there a script i can run on powershell or SQL to find out that information
April 23, 2015 at 1:16 pm
jobs or individual emails that are failing?
here's a quick query you could run on every server via Registeredservers, maybe this gets you started?
SELECT top 100
sent_status As Reason,
err.[description],
mail.*
FROM [msdb].[dbo].[sysmail_allitems] mail
inner join [msdb].[dbo].[sysmail_event_log] err
ON err.mailitem_id = mail.mailitem_id
WHERE mail.send_request_date >= DATEADD(dd, DATEDIFF(dd,0,getdate()), 0) --midnight of today
order by mailitem_id desc
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply