Microsoft KB Archive/297390

= INFO: Comparing Use of ADSI and CDO to Access CDOEXM Recipient-Related Methods =

Article ID: 297390

Article Last Modified on 8/18/2005

-

APPLIES TO


 * Microsoft Windows 2000 Advanced Server
 * Microsoft Exchange 2000 Server Standard Edition
 * Microsoft Exchange 2000 Enterprise Server
 * Microsoft Active Directory Service Interfaces 2.5
 * Microsoft Collaboration Data Objects for Exchange Management 1.1
 * Collaboration Data Objects for Exchange 2000

-



This article was previously published under Q297390



SUMMARY
This article describes the advantages and disadvantages of the use of Active Directory Service Interfaces (ADSI) objects versus the use of Collaboration Data Objects (CDO) to query for the CDO for Exchange Management (CDOEXM) interfaces IMailboxStore, IMailRecipient, and IDistributionList for Active Directory and Exchange objects.



MORE INFORMATION
The CDOEXM library is a set of interfaces that expose properties and methods that enable the user to perform several Exchange recipient-related and Exchange Server-related tasks. For more information about what tasks you can perform, see the following MSDN Web page:

Recipient Management Interfaces

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_cdo_recipient_management_interfaces.asp

The interfaces in the CDOEXM library that expose recipient-related properties and methods are the following:
 * IMailRecipient
 * IMailboxStore
 * IDistributionList

These recipient-management interfaces are aggregated into the CDO.Person(IPerson), CDO.Folder(IFolder), ADSI Contact(IADs), ADSI User(IADsUser), and ADSI Group(IADsGroup) objects. This means that the IMailRecipient, IMailboxStore, and DistributionList interfaces are exposed by these objects and therefore can only be derived from interfaces that are exposed on these objects.

For example, to use a method on the IMailRecipient interface against an Active Directory user, first either an ADSI IADsUser or CDO.Person object must be created and bound to that user. Once this is accomplished, the IMailRecipient interface can be queried for on this object. The CDOEXM recipient management interfaces cannot be directly used to bind to an object.

NOTE: CDOEXM.dll is installed when you install the Exchange 2000 Management Tools.

Based on the tasks that you intend to perform through the use of the CDOEXM recipient-management interfaces and based on your familiarity with CDO or ADSI, you may decide which to use with CDOEXM. The following comparison may help you decide which to use.

Advantages of Using ADSI

 * Minimum software requirement: An application that uses ADSI and CDOEXM recipient-management interfaces does not have to be run on an Exchange 2000 Server. This differs from using CDO, which requires that the program be run on an Exchange 2000 Server. CDOEXM does require that the code be run on a Windows 2000 Server or Windows 2000 Advanced Server-based system that has the Exchange 2000 Management Tools installed.

NOTE: An attempt to copy Cdoexm.dll and register this file through the use of Regsvr32 may not work properly. The only acceptable configuration in which to use any of the three CDOEXM recipient-management interfaces is to have Exchange 2000 Management Tools installed on a Windows 2000 Server-based or Windows 2000 Advanced Server-based computer.
 * Managing groups: Groups can be managed only through the use of ADSI. IADsGroup and IADs interfaces can be used to interact with Active Directory group objects. The CDOEXM.IDistributionList and CDOEXM.IMailRecipient interfaces can be derived from these interfaces.

Disadvantages of Using ADSI

 * Mail properties: Manipulation of mail-related properties on public folders requires the use of the CDOEXM.IMailRecipient interface, but this interface cannot be derived from any of the ADSI objects. To manipulate these proprieties, you can instead use CDO, as explained later in this article.

Advantages of Using CDO

 * Mail properties: CDO provides the ability to manipulate mail-related properties on public folders. To access these properties, you can use the CDO.IFolder interface to bind to the folder and then query for the CDOEXM.IMailRecipient interface.

Disadvantages of Using CDO

 * Minimum software requirement: Code that uses CDO and CDOEXM recipient-management interfaces must be run on an Exchange 2000 Server. This is because the CDO interfaces (Cdoex.dll) are installed as part of Exchange 2000 Server.

WARNING: Microsoft does not support manual copying and registration of Cdoex.dll because this can lead to compatibility problems.
 * Managing Groups: The CDO interfaces cannot be used to manage Active Directory group objects. To accomplish this you can use ADSI, as explained earlier in this article.

