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 email@example.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.