Batch and Automate Distribution List membership


***Please read update in Red at the bottom of this post***

Immagine you are in the I.T. Department at a larger company.  Now immagine that your users get a lot of e-mail, seriously, thousands a day – mostly because they are on distribution lists for the company which receive a lot of mail.  Now picture these users traveling internationally and wanting to save on roaming data charges by cutting down on the volume of e-mail they receive on their mobile phones, or simply want to go on vacation and not have to deal with the burden of managing their e-mail while they are out of the office.  On top of all this (by this time you may really working your immagination) the users want you to take them off of a huge number of lists at weird times of the day such as 10pm.  In addition they want to be re-added at 5am the following week.

How do you handle the above scenario?  What would you do?  Normally the users I deal with may just accept that they have to stick with normal business hours for list changes such as I described above.  Or perhaps they will rely on international I.T. Support to do it for them due to the convenience of time zone differences.

What if there were a better way to deal with this situation?  Would you be interested?  What if there was a way to batch and automate the addition or removal of Distribution Lists on a user’s account?

I found myself in exactly the same situation I described above.  I spent some time researching my options and trying to find a good solution; something that would let me create batch files which could be setup as a scheduled task in widnows.  Something that could add and remove DLs from a user’s profile at any time of the day or night without me having to pyhsically make the change myself.  To my surprise, I couldn’t find anything out there that would do the job.  Thats when I decided to head over to vbforums.com and ask for some help creating an application or script that would do what I needed.

With gracious work by member chris128, a new application was created that completely takes care of the above scenarios.  Chris created an application called DLManager in VB.NET, and I performed real world testing and evaluation of the program.  This is a very useful application that goes even beyond Distribution List management into the realm of security groups as well.  Which means you could batch, automate and schedule Active Directory security group membership changes as well.

Application Information:

* Compiled VB.NET executable meant to be called from the command line
* Requires the .NET framework 2.0 or higher in order to function
* Can be run in a DOS batch file
* Can be scheduled via batch script or other automation tool (see http://www.networkautomation.com)
* Very small footprint at less than 30kb in size
* .ini config file to hangle AD domain configuration information

Command line syntax: dlmanage.exe [add/remove] [target AD username]  [DLNAME] (OPTIONAL): adminusername adminpassword

Example for admin user: dlmanage remove jdoe “Information Technology”

Example for non-admin user: dlmanage remove jdoe “Information Technology Administrator AdminPasswordHere

NOTE: Quotes are only needed for DL or security groups that have spaces in the name.

(this download is free software, and full credit goes to the author, see author’s site for more details)

************* IMPORTANT***************
Chris has released an updated version that is easier to use, has new featuers like better error handling, primary group awareness and no more config.ini file.  I’ve updated the download link to give you the newer version of the program.  For complete details, please see Chris’s Site at
http://www.cjwdev.co.uk/Software/DLManage/Info.html

Updated program syntax example: DLMAnage Add username group1,group2,group3

About Joe

I am the author of this blog, IT engineer, husband, father, and somewhat of a nerd.

Posted on August 12, 2008, in Active Directory, Exchange, General, Products I use, Professional/Tech, Software, Technology. Bookmark the permalink. 4 Comments.

  1. Wow I only just found this blog post… I cant believe it has been 2 years since I wrote this program! How time flies.
    Anyway, I’ve finally got round to sorting my website out as I’m going to be providing a few more free applications very soon (just finished one that cleans up unused user/computer accounts in your domain) and I think I might release a new version of DLManage as I’ve learnt a lot in the last 2 years that could help to improve it. So I was wondering if I send you a link to the new version in a couple of days would you be able to change this post so that it provides a link to the download page on my site rather than downloading it straight from your site? That way people will always get the latest version and they may also find other apps that are useful to them on my site as well 🙂

    Cheers
    Chris

    • Cool, glad you found the post! Absolutely i would love to update the post with a new version. And I’d be happy to link back to your other apps too.

  2. OK cool, I’ve finished re-writing it (god it was messy before!) so here’s a link to the new version on my site: http://www.cjwdev.co.uk/Software/DLManage/Info.html

    There’s a few new features in this version compared to the version you had got posted here – a new argument (ViewMembers), better error handling, primary group awareness, and no need for that stupid Config.INI file anymore 🙂

    Cheers
    Chris

  3. Denny Medeiros

    Wow! very impressive thank you so much for this tool..

%d bloggers like this: