XCLN: Using CDO to Search the Exchange Global Address List for CdoPR_MHS_COMMON_NAME is Slow

ID: Q225500


The information in this article applies to:


SYMPTOMS

When using CDO to find entries in a large Exchange Server global address list (GAL) using the property CdoPR_MHS_COMMON_NAME, the operation can take a long time to complete. The CdoPR_MHS_COMMON_NAME property is sometimes referred to as the "alias" or "mailbox" name.

Consider the following Visual Basic code-fragment:
(Assume that the MAPI session is already established, and that NameToSearch contains a string name).


Dim objSession As MAPI.Session
Dim objAddrEntFilt As MAPI.AddressEntryFilter
Dim objAddressEntries As MAPI.AddressEntries
Dim objAddressEntry As MAPI.AddressEntry

Set objAddressEntries = objSession.AddressLists("Global Address List").AddressEntries
    
objAddrEntFilt.Fields.Add (CdoPR_MHS_COMMON_NAME), NameToSearch
        
Set objAddressEntry = objAddressEntries.GetFirst 
The objAddressEntries.GetFirst method may take a long time to execute based on the size of the global address list.


CAUSE

With respect to the AddressEntryFilter object, the platform SDK currently documents the following:

For fields of data type String, the restriction type is RES_CONTENT with fuzzy level options FL_SUBSTRING, FL_IGNORECASE, and FL_LOOSE. However, the following MAPI properties are compared using FL_PREFIX instead of FL_SUBSTRING:

PR_ACCOUNT
PR_BUSINESS_ADDRESS_CITY
PR_COMPANY_NAME
PR_DEPARTMENT_NAME
PR_DISPLAY_NAME
PR_GIVEN_NAME
PR_OFFICE_LOCATION
PR_SURNAME
PR_TITLE
Because CdoPR_MHS_COMMON_NAME (PR_MHS_COMMON_NAME) is not listed, a search (restriction) using this MAPI property will result in a restriction type of RES_CONTENT with the fuzzy level options FL_SUBSTRING, FL_IGNORECASE, and FL_LOOSE. These fuzzy level options result in an inefficient (wildcard type of) search mechanism, and it is recommended that searches for MAPI properties not using FL_PREFIX be avoided.


RESOLUTION

A modification was made to Cdo.dll to treat PR_MHS_COMMON_NAME as it does PR_ACCOUNT (and the other MAPI properties listed above) which results in an efficient FL_PREFIX search.

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next Microsoft Exchange Server version 5.5 service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:

Component: Cdo.dll

File name Version
Cdo.dll 5.5:2580.0


NOTE: If this product was already installed on your computer when you purchased it from the Original Equipment Manufacturer (OEM) and you need this fix, please call the Pay Per Incident number listed on the above Web site. If you contact Microsoft to obtain this fix, and if it is determined that you only require the fix you requested, no fee will be charged. However, if you request additional technical support, and if your no-charge technical support period has expired, or if you are not eligible for standard no-charge technical support, you may be charged a non-refundable fee.

For more information about eligibility for no-charge technical support, see the following article in the Microsoft Knowledge Base:
Q154871 Determining If You Are Eligible for No-Charge Technical Support


WORKAROUND

Extended MAPI could be used instead of Cdo.dll providing more control for the creation of restrictions.


STATUS

Microsoft has confirmed this to be a problem in Exchange Server 5.5.

Additional query words:


Keywords          : 
Version           : winnt:5.5
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: June 28, 1999