Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  Windows Development  »  Interop  »  Using C# to Create Distribution Lists
Using C# to Create Distribution Lists
by Muthukumar V | Published  05/10/2005 | Interop | Rating:
Muthukumar V
I am a Programmer in C++/VC++/C#. http://www.codersource.net 

View all articles by Muthukumar V...
Introduction

Home Page: http://www.codersource.net

  A Distribution List can be created like a normal mailbox with only a small difference.  This is that it can contain other mailboxes and distribution lists as members for itself. A mailbox or a distribution list is created below the Site Container of an Exchange domain. Once this entity is created depending on the replication timing, it becomes available on the Global Address List. This article tries to explain how to access the exchange domain and create a distribution list and create a distribution list programmatically using C# and Active Directory.

   Typical Issues that arise when someone programmatically tries to create the distribution list is that they cannot create a distribution list if they are not connected to the server on the site. i.e., If the user of Site1 tries to modify the details of a Distribution List on a different site say Site2 through the program, this won't be permitted. In this case the user with administrator rights must logon again using the server which hosts the corresponding site.

   Some other issues could be like finding all the connected Sites, Servers in an exchange environment. Also parsing the address book for some data using ADSI will likely to be slow. This article and the sample program use an approach combining both CDO and ADSI for creating distribution list with C#. This can easily be extended to creating mailboxes also.

Microsoft Exchange Architecture:

A Microsoft Exchange Environment can be configured to contain many sites under a domain. Though all of us might know this, this might be useful if we do a small preview of the basic details.

If a domain Microsoft.com is available as root, there could be many sites configured under the root domain of Microsoft.com like London, Newyork, Moscow. This has many advantages.

  • Easier localized management of users.
  • Logical classification of employees/users
  • Faster access because of localized placement of servers
  • All the mail addresses can be accessed together through a Global Address List.
  • and many more..

   And apart from this each of the domains can contain many servers which can handle the mail delivery mechanisms to share the load of the site under the domain. The architecture looks something like this.

  Typically if a user wants to modify any Distribution List members or any other data of Distribution list the user has to have the relevant admin rights. The Microsoft Exchange Administrator program is usually used to make  the modifications on these data on Distribution List. Occasionally Outlook can also be used to modify the membership of the Distribution List, provided the logged on user is either an administrator or he is the owner of the distribution List. But whatever may be the case, cross site modifications are not allowed. So the program has to be careful to use the correct server in order to do the same.

Sponsored Links