Generate DLs for Each Exchange Server

This Perl script generates distribution lists for Exchange 5.5 servers.

Readers

September 23, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today


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 servername@yourdomain.com.

To use the script in Listing 1, you need to install Exchange Administrator and Perl. I used ActiveState's Perl version, available at http://www.activestate.com/products/activeperl. 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.

—Franaur Tan
[email protected]

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like