Microsoft KB Archive/248768

From BetaArchive Wiki
Knowledge Base

ADSI Not Retrieving Multivalued Attributes Correctly for Dynamic Users

Article ID: 248768

Article Last Modified on 12/23/1999


  • Microsoft Site Server 3.0 Standard Edition

This article was previously published under Q248768


Dynamic multivalued string attributes do not support duplicate entries. For example, storing the values "1" "2" "2" will on read only return "1" "2". In other words, entries with the same value are only stored once.


This is by design.


If you change the Schema of the Membership Directory so that the isSearchable attribute of the multivalue attribute entry is set to 0, this allows duplicate entries to be stored in dynamic multivalued string attributes.

The following example code shows how to do this for the sample attribute named MultiValueAttribute.

    Dim adsLDAP
    Dim adsMembersContainer
    Dim adsMember
    Dim I

    ' Connect to the members container
    Set adsLDAP = GetObject("LDAP:")
    Set adsMembersContainer = adsLDAP.OpenDSObject( _
        "LDAP://" & g_strLDAPServerName & ":" & g_strLDAPPortNumber & "/o="
& g_strLDAPOrganizationName & _
        "/ou=Admin/cn=Schema", _
        g_strAdministratorDN, g_strAdministratorPassword, 0)

    ' Get the member information and attributes
    Set adsObject = adsMembersContainer.GetObject("attributeSchema",
    adsObject.Put "isSearchable",0

    ' Perform cleanup
    Set adsMember = Nothing
    Set adsMembersContainer = Nothing
    Set adsLDAP = Nothing

Keywords: kbprb KB248768