Microsoft KB Archive/302704

= How to Obtain Exchange MAPI Membership Without Distribution Lists =

Article ID: 302704

Article Last Modified on 5/28/2003

-

APPLIES TO


 * Microsoft Exchange Server 5.5 Standard Edition
 * Microsoft Metadirectory Services 2.2 Service Pack 1

-



This article was previously published under Q302704



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.



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:  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.  In MMS Compass, click the Exchange MAPI MA. Click Configure MA, click the Connected Directory Specifics tab, and then click the Attributes to Discover tab. 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,...

  Modify the Add and Modify parsing templates:  Click the Exchange Management Agent you want to modify.</li> Click Design MA, and then click the Control the Metadirectory tab.</li> Add the following entries to both the Add and Modify tabs:

%- Member:$cd.member

</li></ol> </li> Modify the Add and Modify output templates:  Click the Exchange Management Agent you want to modify.</li> Click Design MA, and then click the Control Connected Directory tab.</li> Click the Output Templates tab.</li> Add the following entries to both the Add and Modify tabs:

($MULTI_VALUED(&quot;0&quot;,$cd.member,&quot;- Member 1):&quot;))

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 &quot;raw&quot; properties of the &quot;MEMBER OF&quot; field in a mailbox that belongs to a distribution list.</li></ol> </li> 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:

$mv.member=$cd.member
 * 1) UPDATE THE DL MEMBERSHIP IN THE METAVERSE

IF $mv.givenName=Snook THEN
 * 1) TEST FOR THE CONDITIONAL MEMBERSHIP

$mv.member-=Recipients/cn=AAA IF $EXIST(&quot;$mv.member&quot;)=TRUE THEN ELSE IF $EXIST(&quot;$cd.member&quot;)=TRUE THEN
 * 1) REMOVE THE AAA DL FROM MEMBERSHIP

$mv.member+=NO-DL ENDIF ENDIF ELSE
 * 1) ADD IN A FAKE DISTRIBUTION LIST SO THAT THE OPTIONAL FIELD WILL
 * 2) CONTAIN A VALUE AND ATTEMPT TO UPDATE EXCHANGE.
 * 3) IF THERE IS NO VALUE, IT WON'T REMOVE THE LAST DISTRIBUTION LIST
 * 4) FROM EXCHANGE.

$mv.member+=Recipients/cn=AAA ENDIF
 * 1) MERGE THE AAA DISTRIBUTION LIST INTO MEMBER

$cd.member=$mv.member
 * 1) SEND THE MEMBERSHIP TO THE EXPORT

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.</li></ol>

Additional query words: mms metadirectory zoomit

Keywords: kbhowto KB302704

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.