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

In reply to Re: MS Exchange Data Location by enoch
in thread MS Exchange Data Location by Tuna

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.