{"id":125,"date":"2015-08-11T00:00:00","date_gmt":"2013-01-01T00:00:00","guid":{"rendered":"https:\/\/www.sqlhammer.com\/adding-your-entire-enterprise-into-red-gate-sql-multi-script-distribution-list"},"modified":"2026-03-18T21:52:02","modified_gmt":"2026-03-18T21:52:02","slug":"adding-your-entire-enterprise-into-red-gate-sql-multi-script-distribution-list","status":"publish","type":"post","link":"https:\/\/sqlhammer.com\/index.php\/2015\/08\/11\/adding-your-entire-enterprise-into-red-gate-sql-multi-script-distribution-list\/","title":{"rendered":"Adding Your Entire Enterprise into Red-Gate SQL Multi Script Distribution List"},"content":{"rendered":"<p><a href=\"http:\/\/www.red-gate.com\/\">RedGate<\/a> sells a product call <a href=\"http:\/\/www.red-gate.com\/products\/dba\/sql-multi-script\/\">SQL Multi Script<\/a>. The product allows you to asynchronously execute T-SQL scripts to large quantities of servers. There are a number of useful administrative tasks which can be made easier with this product.<\/p>\n<p>One task, however, that is difficult to perform in SQL Multi Script is adding servers to the distribution lists. To be clear, adding one server, or maybe a half dozen, is easy. The tedium comes into play when you have an existing enterprise with dozens or hundreds of SQL Servers. Manually adding each server and saving the distribution list becomes time consuming.<\/p>\n<p>I have created a solution which solves that problem, if you are using SQL Server\u2019s Central Management Server to keep track of your server list. <em>This solution could easily be modified to read from a text file or Excel as well, I\u2019m just not providing the complete code for those avenues.<\/em><\/p>\n<h2>Bulk loading servers into a distribution list<\/h2>\n<p>SQL Multi Script saves the server entries for your distribution lists in XML format in an Application.dat file.<\/p>\n<p>> %AppData%\\Roaming\\Red Gate\\SQL Multi Script\\Application.dat<\/p>\n<h3>Snippet from the Application.dat file<\/h3>\n<p><a href=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/application-dat-xml1.png\"><img decoding=\"async\" src=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/application-dat-xml1.png\" alt=\"\" \/><\/a> <a href=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/application-dat-xml2.png\"><img decoding=\"async\" src=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/application-dat-xml2.png\" alt=\"\" \/><\/a><\/p>\n<h3>Generate the XML<\/h3>\n<p>In order to load our server list, all we will need to do is generate the XML and copy\/paste. The below query can be run on your SQL Server Central Management Server and generate the two sets of XML.<\/p>\n<p><a href=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/Generate-XML-For-MultiScript.png\"><img decoding=\"async\" src=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/Generate-XML-For-MultiScript.png\" alt=\"\" \/><\/a><\/p>\n<p><em>Click <a href=\"\/wp-content\/uploads\/MultiScriptDistributionList.txt\">here<\/a> for the code in text format.<\/em><\/p>\n<h3>Paste<\/h3>\n<p><em>Make sure that you close SQL Multi Script before opening the Application.dat file. If you don\u2019t, there is a chance that SQL Multi Script will overwrite your changes, reverting them back to its original state.<\/em><\/p>\n<p>With the Application.dat file open in your favorite text editor, copy\/paste the entire [Multi-Script Database Elements] column into the <em>databaseLists<\/em> XML element.<\/p>\n<p>Next, copy\/paste the entire [Multi-Script Server Elements] column into the <em>addedServers<\/em> XML element.<\/p>\n<p>Save the file and launch SQL Multi Script. You should see your distribution list populated on the right.<\/p>\n<p><a href=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/distributionlist.png\"><img decoding=\"async\" src=\"http:\/\/www.sqlhammer.com\/wp-content\/uploads\/2015\/07\/distributionlist.png\" alt=\"\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RedGate sells a product call SQL Multi Script. The product allows you to asynchronously execute T-SQL scripts to large quantities of servers. There are a number of useful administrative tasks which can be made easier with this product. One task, however, that is difficult to perform in SQL Multi Script is adding servers to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,7,10,11,14],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administration","category-career","category-community","category-disaster-recovery","category-general","category-performance"],"_links":{"self":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":1,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/125\/revisions\/387"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/media\/575"}],"wp:attachment":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}