I work a lot with MS Exchange, also. I am still playing with the LDAP stuff and trying to get Exchange to comply (which isn't trivial).
In the meantime, I have kludged a little system together that will do what I need it to do via system calls to the admin.exe program that comes with Exchange Admin.
open(CSV,">import.csv"); #open file to import to Exchange
# write the CSV header
my $lineCSV = "Obj-Class,Mode,First Name,Last Name,Display Name,";
$lineCSV .= "Alias Name, Directory Name,Primary Windows NT Account,";
$lineCSV .= "Home-Server,Hide From AB,Alternate recipient,";
$lineCSV .= "Deliver to both,E-mail address\n";
# write the data we want to import
$lineCSV .= "MAILBOX,UPDATE," . $firstname . "," . $lastname . ",";
$lineCSV .= "\"" . $fullname . "\"," . $username . "," . $username . "
+,";
$lineCSV .= "domain\\" . $username . ",MAILSERVER";
$lineCSV .= "0,,,";
#print it to CSV and close it
print CSV $lineCSV;
close(CSV);
# run the commandline import with specified options
my $exchCommand = "c:\\exchsrvr\\bin\\admin.exe /i import.csv ";
$exchCommand .= "/d " . $refRS->Fields("mailServer")->value;
$exchCommand .= " /n /o options.txt";
my $exchOut = `$exchCommand`;
Like I said, it is a huge kludge; but it gets the job done while I torture the Exchange server trying to get the LDAP stuff going.
For distribution lists, everything is surprisinly similar. Here is a good Exchange reference article. But, the big thing to change is the Obj-Class field needs to be "DL" and not "MAILBOX." But, reading the article over and playing with the command, you will get used to it (as much as anyone can get used to Exchange).
Jeremy
| [reply] [d/l] [select] |
I know alot of that information is stored in the LDAP for exchange but I am not sure where the distrobution lists are.
--BigJoe
Learn patience, you must. Young PerlMonk, craves Not these things. Use the source Luke. | [reply] |