Is this even possible?! Mass update agent jobs via script.

  • Hi,

    I've got roughly 60 agent jobs that have a step in them to send an email to a list of email addresses, and now they all need to be updated to remove one of the individuals email addresses. Is it possible to update all the jobs via script? or do I have to open each job and perform the update manually?

    TIA

  • You can either browse sysjobsteps and perform an update against that, or script out all your jobs and do a find/replace on the email you want to remove, and rebuild the jobs that way.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Potentially you can do an update to msdb, but I would be very careful here.

    You should not be sending to users, but to a distribution list of some sort. This way you remove the administration of the notification list to a central point.

  • Note that sp_update_job might be your best bet, script a loop through all jobs

    http://msdn.microsoft.com/en-us/library/ms188745.aspx

    Again, change this to a distribution list, not a list of individual emails

  • Thanks for the feedback guys. unfortunately I've been pushing our clients to convert over to distribution lists for years now, but the majority dont want to do it, so i'm stuck dealing with this pain in the arse.

Viewing 5 posts - 1 through 4 (of 4 total)

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