Check DB Mail Status on All the servers...

  • 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

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply