Generate DLs for Each Exchange Server


I manage several Exchange Server 5.5 servers locally and abroad. Sometimes I need to perform a maintenance task on a particular server and want to inform only the users that server hosts. The usual solution is to build a distribution list (DL) for each server, with each DL containing the server's hosted mailboxes. (Microsoft says that the next release of Exchange 2000 Server, code-named Titanium, will support dynamic DLs.) Manually maintaining DLs or rebuilding a list from an export file might be sufficient for some companies, but doing so in a dynamic environment such as mine is a tedious, ongoing process. I decided to use Perl to automate this process in my company. I set the script that Listing 1 shows to run every day at 6:00 a.m. This script generates DLs for each server in my Exchange organization. To use my script in your environment, simply edit the $sConst variables' values at callout A. These variables are

  • $sConstExchServer—the server on which you'll export and import the Comma Separated Value (CSV) files
  • $sConstExchAdmin—the path to where Microsoft Exchange Administrator is installed
  • $sConstExchOrgName—your Exchange organization's name
  • $sConstExchContain—the container in which you want to create the DLs
  • $sConstDomain—the email domain name created for each server

The created DLs will be hidden; you can reference them by

To use the script in Listing 1, you need to install Exchange Administrator and Perl. I used ActiveState's Perl version, available at http:// Since deploying my script, I've expanded my scripts to include other DLs (e.g., per building, per country), as well as a one-way update from a Remedy Oracle database.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.