Slashdot Mirror


Using Perl to Automate Exchange 2000 Tasks?

en4ca asks: "We have recently started using Exchange 2000 on a W2k platform with Active Directory at work. Previously, we used a mailsystem that could be easily controlled by command-line paramaters (and hence by perl). What I wanted to ask was, has anyone used perl to automate boring, mundane tasks in Exchange like mass creating mailboxes? What did you use to do this? [code would be very much appreciated] I've tried using Win32::OLE, but havn't had much success"

17 comments

  1. Scripting Exchange 2K by Jeremiah+Cornelius · · Score: 2

    With Exchange 2000, you are really looking for the ADSI scripting interface to ActiveDirectory - as the Exchange DS is merged into AD. Check out Microsoft Technet.

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  2. Trolls by pongler · · Score: 1

    Wow, there haven't been any trolls yet about exchange sucking (tho there was only one message posted so far)! On a different note are there any exchange clients for Linux?

    1. Re:Trolls by Jeremiah+Cornelius · · Score: 3, Informative
      Exchange client for Linux? Try Ximian's Evolution, with the "Premium" Exchange connector they are releasing next month.

      Otherwise, Netscape etc. work as decent IMAP clients - as long as you don't expect to use calendar/scheduling, tasks or notes!

      --
      "Flyin' in just a sweet place,
      Never been known to fail..."
    2. Re:Trolls by Mr.+Foogle · · Score: 2, Informative

      There are indeed - but I have not tried it yet - if I recall right Bynari sells a version of the client, and open sourced an older version ..

      http://www.bynari.net

      --
      Display some adaptability.
  3. The real way to do it (typical pro-linux /. reply) by Snafoo · · Score: 0, Troll

    (1) smbmount the C-drive (as /c, say) and then type rm -rf /c

    (2) Edit /etc/aliases to contain the appropriate mailboxen. Use perl, use emacs, use sed, use whatever your heart desires.

    (3) Unplug the W2k machine.

    (4) ifconfig eth0:1 up

    This is what I call 'failover, sunny-side up' :)

    --
    - undoware.ca
  4. Step back and think by Anonymous Coward · · Score: 0

    Microsoft products are not Turing-complete *on purpose*. This allows MS to have a large pool of missing features that they can code and use to sell future versions. To take your example, mass creating of mailboxes might be implemented in the next version of Exchange, with a peculiar GUI you'll have to learn. When there are too many features, you get an animated assistant to help you find and use what you need.

    "Small set of orthogonal tools" vs "10,000 tools for everything you'll ever need" are two styles for two different worlds. The geek world, and the PHB world. Know thyself.

    1. Re:Step back and think by MindStalker · · Score: 1

      WTF has Turing-complete have ANYTHING to do with this. Lay off the buzzword crackpipe for just a moment, please!

    2. Re:Step back and think by carleton · · Score: 1

      Turing-complete!

      You keep using that word. I do not think it means what you think it means.

      (with apologies to Princess Bride).
      Actually, the last time I heard the words "Microsoft products" and "Turing-complete", it was in the context of how too many Microsoft features are essentially Turing-complete, specifically things like Word Macros.

  5. Re:The real way to do it (typical pro-linux /. rep by Snafoo · · Score: 1

    Well, I suppose if you want it to work, you should also call newaliases somewhere in there....

    Sigh. Maybe I'm increasing my boss' total cost of ownership after all..... :)

    --
    - undoware.ca
  6. Check out this book by SuiteSisterMary · · Score: 2

    ADSI Scripting For System Administration should give you a starting point.

    --
    Vintage computer games and RPG books available. Email me if you're interested.
  7. Other interfaces by jbert · · Score: 4, Informative

    ADSI edit is one way to twiddle active directory.

    You can also get in over LDAP. This can be done nicely from perl with the 'Net::LDAP' module, available under the name 'perl-ldap' from CPAN and with a homepage on sourceforge.

    It is a useful interface, the biggest hurdle you are likely to face is authenticating yourself properly to the directory. There may be bits and pieces of example code in the distribution, otherwise do the web search thing and check the mailing list (and archives) for answers.

    1. Re:Other interfaces by rkhalloran · · Score: 1

      The problem with using vanilla LDAP to get to Active Directory is that the authentication part (i.e. passwords) is actually in Kerberos, so you can't do the usual LDAP password tricks.

      Just another case of MS supporting 'open' standards: jam two of them together into a bastard blend that only MS can/will support...

  8. Use Exmerge by vinay_k_gupta · · Score: 1

    If you are just moved to exchange then download exmerge, one of the best exchange utility that is free from microsoft. Start using exmerge for backup, recovery and virus removal from database. It has both GUI and config file options.

    Have fun.

  9. hello directory import.. by Anonymous Coward · · Score: 0

    Just learn how to use Excel and do Exchange Directory Imports for mass-creating of accounts. Much faster than trying to write some ADSI script to do the job. If you set up a good Excel template all you have to do is put their personal info in a column and Excel can generate the Primary NT Account and Directory Name for you as long as you use sane naming conventions.

  10. Hm. by mlc · · Score: 2
    I'm totally making this up, as I haven't done any Windows development in about 1.5yrs, but you might try looking at ActiveState's Perl COM stuff. I did use it for something, but don't recall if it worked well or not.

    If it works well, then you can read MS docs to figure out what kind of COM interfaces are exposed by Exchange, and work from there.