Microsoft KB Archive/312388

= Custom Full Name Attribute Setting Is Ignored by the ADMA =

Article ID: 312388

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Metadirectory Services 2.2 Service Pack 1
 * Microsoft Metadirectory Services 2.2 Service Pack 1

-



This article was previously published under Q312388



SYMPTOMS
If you use Microsoft Metadirectory Services (MMS) to create new objects in both the Active Directory management agent (ADMA) connector space and in Active Directory, these objects unexpectedly use the relative distinguished name of the metaverse object. This problem occurs even if you configure the ADMA to create a customized Full Name attribute. Typically, the relative distinguished name is the metaverse object's common name. When this problem occurs, error messages are not logged in any of the log files to warn you that the custom configuration was ignored.

NOTE: This article describes the cause of this problem and how to resolve it. However, please read the following article carefully to review how the Full Name attribute is configured. MMS and the ADMA configures the Full Name attribute differently than the corresponding Display Name and User Logon Name attributes.

311027 Configure the ADMA to Set a Customized Full Name Attribute



CAUSE
This problem may occur if a multiple-component relative distinguished name exists in the metaverse distinguished name ($mv.dn). The Active Directory relative distinguished name and the connector space relative distinguished name must match; however, Active Directory does not support multiple-component relative distinguished names. For more information about multiple-component relative distinguished names, refer to the &quot;More Information&quot; section of this article.

The New Connectors template contains a code that automatically modifies the common name if a plus sign (+) is present in the distinguished name of the object. This functionality ensures that the relative distinguished name that MMS builds for the Active Directory object is compliant with the Active Directory requirements. The relative distinguished names must match to guarantee that the new Active Directory object is successfully discovered by MMS during subsequent discoveries.



RESOLUTION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To resolve this problem:  Use Compass to log on to MMS as an administrator. Click Management Agents on the Bookmarks menu in the left pane. Click the appropriate ADMA in the right pane. Click Design MA on the Actions menu in the left pane. Click the Control Connected Directory tab. Click the Output Construction Templates tab.</li> Click the New Connectors tab.</li>  Locate the following section: $v_fullName = $replace($v_fullName, &quot;,&quot;, &quot;\,&quot;)
 * 1) We need to escape the  comma in the RDN

if $EXISTS($v_fullName) = TRUE then if $EMBEDDED(&quot; + &quot;, $mv.dn) = TRUE then $v_cdDn = CN= $GET_SUBSTRING($DN_COMPONENT($mv.dn, 1), &quot;&quot;, &quot; + &quot;), $parent(&quot;$v_cdDn&quot;) else $v_cdDn = CN= $v_fullName, $parent(&quot;$v_cdDn&quot;) endif endif </li>  Replace the code that you located in the previous step with the following code: if $EXISTS($v_fullName) = TRUE then if $EMBEDDED(&quot; + &quot;, $v_fullname) = TRUE then $v_cdDn = CN= $GET_SUBSTRING($DN_COMPONENT($v_fullname, 1), &quot;&quot;, &quot; + &quot;), $parent(&quot;$v_cdDn&quot;) else $v_cdDn = CN= $v_fullName, $parent(&quot;$v_cdDn&quot;) endif endif NOTE: The preceding code is used in both a section for users and a section for contacts. If the object is a contact, the code is located later in the template. Ensure that you change the correct section of code based on whether the affected object is a user or a contact. </li> Click OK.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
The following information is taken from the Request for Comments (RFC) 1485, &quot;A String Representation of Distinguished Names&quot;:

The &quot;+&quot; notation is used to specify multiple-component relative distinguished names. In this case, the types for attributes in the relative distinguished name must be explicit.

A multiple-component relative distinguished name is defined as a relative distinguished name that uses two attributes to build the relative distinguished name. The two attributes are concatenated by using a plus sign (+). The following distinguished name is an example of a distinguished name in which the first name is a multiple-component relative distinguished name:

CN=Jeff Smith+UID=1234,ou=Sales,dc=Microsoft,dc=com

The following code is from the New Connectors template of a MMS 2.2 Service Pack 1 (SP1) ADMA, and it is used to process a user object. The same basic code is also used for a contact object later in the template. In the first two sections of code, the template tests for either the $msMMS-AdMaUserFullNameProjection attribute value (the user object) or the $msMMS-AdMaContactFullNameProjection attribute value (contact object). This value depends on the configuration of the Full Name attribute for either the users or the contacts as defined on the Active Directory Creation Settings tab in the Configure the Management Agent dialog box. In the following example, the $v_fullname attribute is assigned a value that is based on the Full name creation template. This template is defined in either the $msMMS-AdMaUserFullNameProjection attribute or the $msMMS-AdMaContactFullNameProjection attribute value, depending on whether the object is a contact or a user.

NOTE: The following code does not reflect the workaround that is described in the &quot;Resolution&quot; section of this article: if $exist($multi_valued(&quot;$MA&quot;, $mv.msMMS-managedByMA)) = TRUE then if $MA($msMMS-AdMaUserFullNameProjection) = SurnameCommaGivenName then $v_fullName = ($mv.sn, )($mv.givenName) else if $MA($msMMS-AdMaUserFullNameProjection) = Custom then $v_fullName = $export_template(&quot;$MA($msMMS-AdMaUserFullNameProjectionTemplate)&quot;) else $v_fullName = $mv.cn           endif endif
 * 1) Check if this object will be a user in which case we must apply the
 * 2) user fullname construction rule

# The object is going to become a contact in AD     # The contact fullname construction rule should be applied else if $MA($msMMS-AdMaContactFullNameProjection) = SurnameCommaGivenName then $v_fullName = ($mv.sn, )($mv.givenName) else if $MA($msMMS-AdMaContactFullNameProjection) = Custom then $v_fullName = $export_template(&quot;$MA($msMMS-AdMaContactFullNameProjectionTemplate)&quot;) else $v_fullName = $mv.cn           endif endif

$v_fullName = $replace($v_fullName, &quot;,&quot;, &quot;\,&quot;)
 * 1) We need to escape the  comma in the RDN

if $EXISTS($v_fullName) = TRUE then if $EMBEDDED(&quot; + &quot;, $mv.dn) = TRUE then $v_cdDn = CN= $GET_SUBSTRING($DN_COMPONENT($mv.dn, 1), &quot;&quot;, &quot; + &quot;), $parent(&quot;$v_cdDn&quot;) else $v_cdDn = CN= $v_fullName, $parent(&quot;$v_cdDn&quot;) endif endif This code sample processes the following multiple-component relative distinguished name in the following way: CN=Jeff Smith+UID=1234,ou=Sales,dc=Microsoft,dc=com First, the object meets the first condition of the embedded plus sign (+): if $EMBEDDED(&quot; + &quot;, $mv.dn) = TRUE Next, the $GET_SUBSTRING function and the $DN_COMPONENT function pull out the first part of the multiple-component relative distinguished name: $v_cdDn = CN= $GET_SUBSTRING($DN_COMPONENT($mv.dn, 1), &quot;&quot;, &quot; + &quot;), $parent(&quot;$v_cdDn&quot;) The $PARENT function is used to add the rest of the structure of the object.

In the last section of the code sample, the $v_fullname attribute is used until the last conditional test. If the $EMBEDDED function finds a plus sign (+) in the distinguished name of the object (if $EMBEDDED(&quot; + &quot;, $mv.dn) = TRUE), the $v_fullname attribute is not used as the relative distinguished name of the $v_cdDn variable. Instead, when MMS builds the Full Name attribute (common name), it looks for the first part of the multiple-component relative distinguished name, and then takes everything which precedes the plus sign (+): ($v_cdDn = CN= $GET_SUBSTRING($DN_COMPONENT($mv.dn, 1), &quot;&quot;, &quot; + &quot;), $parent(&quot;$v_cdDn&quot;)) The $v_cdDn variable is used to build the $cs.dn variable for the connector space objects. Because the connector space relative distinguished name and the connected directory relative distinguished name must match when they are created in the ADMA, the objects that are created in Active Directory use only the first part of the multiple-valued full name instead of the $v_fullname value, as expected.

Additional query words: mms metadirectory zoomit

Keywords: kbenv kbprb kbcode KB312388

-

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

© Microsoft Corporation. All rights reserved.