Database Mail Profile

  • Hi Experts,

    We are planning to delete a particular Mail Profile & Account from all our servers. As a backout plan i like to script out those profiles & Accounts from the server,is there anyway i can achieve the same?

    Thanks IN Advance.

  • Have you looked at the script section of SQLServerCentral?

    http://www.sqlservercentral.com/search/?q=mail&t=s&sort=relevance

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Thanks Hanshi,

    I didnt find any to script out the current mail profiles & Accounts

  • I don't have a script myselef, but it looks like this http://www.sqlservercentral.com/scripts/Database+Mail/100073/ can give you a rather good starting point.

    You can also create a script yourself using the [msdb].[dbo].[sysmail_add_....._sp] stored procedures. Look in BOL for how to use these procedures.

    Another option can be to (re-)create the mail setup using the wizard. Start a profiler trace to capture the commands executed by the wizard. From this trace you can extract the required commands and create your own script.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Thanks Again Hanshi.

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

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