Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to Obtain Exchange MAPI Membership Without Distribution Lists


View products that this article applies to.

This article was previously published under Q302704

↑ Back to the top


Summary

This article describes how you can use Microsoft Metadirectory Services (MMS) version 2.2 Service Pack 1 (SP1) to manipulate distribution list membership in Exchange 5.5 without having to import the distribution lists.

↑ Back to the top


More information

The process that is described in this article:
  • Was developed in response to a customer request that MMS programmatically control membership for several existing site-wide fax distribution lists based on metadirectory attributes.
  • Takes advantage of Exchange replication to update the distribution lists from the contents of the Mailbox member field. You can use this functionality to control distribution list membership without having to bring the distribution lists into MMS.
  • Is designed to work with distribution lists that already exist within Exchange. A logical extension of this process would be to automatically process membership in departmental or organizational distribution list hierarchies.
To use MMS 2.2 SP1 to manipulate distribution list membership in Exchange 5.5 without having to import the distribution lists:
  1. Edit the attribute to discover. Note that MEMBER is defined as a multivalued field in the MMS schema, but does not appear in the default list of attributes to discover.
    1. In MMS Compass, click the Exchange MAPI MA.
    2. Click Configure MA, click the Connected Directory Specifics tab, and then click the Attributes to Discover tab.
    3. In the Current Attributes Discovered box, add the MEMBER attribute between the manager and Obj-Dist-List Exchange Mailbox Attributes to Discover box, for example:
      ...,Manager,member,Obj-Dist-Name,...
  2. Modify the Add and Modify parsing templates:
    1. Click the Exchange Management Agent you want to modify.
    2. Click Design MA, and then click the Control the Metadirectory tab.
    3. Add the following entries to both the Add and Modify tabs:
      %- Member:$cd.member
  3. Modify the Add and Modify output templates:
    1. Click the Exchange Management Agent you want to modify.
    2. Click Design MA, and then click the Control Connected Directory tab.
    3. Click the Output Templates tab.
    4. Add the following entries to both the Add and Modify tabs:
      ($MULTI_VALUED("0",$cd.member,"- Member 1):"))
      The number 1 after Member is there because MAPI requires an index number for updates, even if the same number is used for all values and records. The MEMBER value may be referenced without the Organization and Site portions of the distinguished name if you DISCOVER Exchange at the site level as described in the example that is included later in this article. If not, you must use the long format of the MEMBER distinguished name for reference. To get the long format of the MEMBER variables, view the "raw" properties of the "MEMBER OF" field in a mailbox that belongs to a distribution list.
  4. Edit the Advanced Attribute Flow template. Now that your MA is able to bring in the MEMBER field, you can manipulate the values to change the distribution lists that are listed for the person object. View the MMS documentation for an explanation of Multivalued Attribute Operators. For example, you might configure your Advanced Attribute Flow with something that is similar to the following example:
    # UPDATE THE DL MEMBERSHIP IN THE METAVERSE
    $mv.member=$cd.member
    
    # TEST FOR THE CONDITIONAL MEMBERSHIP
    IF $mv.givenName=Snook
    THEN
    
    # REMOVE THE AAA DL FROM MEMBERSHIP
        $mv.member-=Recipients/cn=AAA
        IF $EXIST("$mv.member")=TRUE
        THEN
        ELSE
            IF $EXIST("$cd.member")=TRUE
            THEN
    
    # ADD IN A FAKE DISTRIBUTION LIST SO THAT THE OPTIONAL FIELD WILL 
    # CONTAIN A VALUE AND ATTEMPT TO UPDATE EXCHANGE.  
    # IF THERE IS NO VALUE, IT WON'T REMOVE THE LAST DISTRIBUTION LIST 
    # FROM EXCHANGE.
                $mv.member+=NO-DL
            ENDIF
        ENDIF
    ELSE
    
    # MERGE THE AAA DISTRIBUTION LIST INTO MEMBER
        $mv.member+=Recipients/cn=AAA
    ENDIF
    
    # SEND THE MEMBERSHIP TO THE EXPORT
    $cd.member=$mv.member
    							
    Because the output templates are already prepared to export the MEMBER field in a multivalued format, the distribution lists that are listed will be appended or deleted appropriately. Note the NO-DL member in the preceding example. This is to guarantee that there is a value in the MEMBER field for processing. Because it does not match a valid distribution list, the MEMBER field will be updated with NULL. Without such a fake distribution list, there would be no line in the intermediate file to update Exchange when the last MEMBER is removed.

↑ Back to the top


Keywords: KB302704, kbhowto

↑ Back to the top

Article Info
Article ID : 302704
Revision : 2
Created on : 5/28/2003
Published on : 5/28/2003
Exists online : False
Views : 262