Microsoft KB Archive/290999

= INFO: Determine the lDAPDisplayName for an Attribute =

Article ID: 290999

Article Last Modified on 2/23/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Active Directory Service Interfaces 2.5
 * Microsoft Active Directory Service Interfaces 2.5

-



This article was previously published under Q290999



SUMMARY
The name an attribute as referred to in the Active Directory Users and Computers snap-in user interface (UI) does not always match the lDAPDisplayName for the attribute. If you are attempting to programmatically refer to an attribute, you must use the lDAPDisplayName.

This article provides a Microsoft Visual Basic script using ADSI that will enable you to easily determine the lDAPDisplayName for an attribute shown in the UI.



MORE INFORMATION
The UI gets its information about what to display on property sheets from a display specifier object. The display specifier objects are stored in locale-specific containers in the DisplaySpecifiers container in the Configuration container. The DisplaySpecifiers container has subcontainers that correspond to the various locales supported by the enterprise installation. These subcontainers are named by using language identifiers (for example, the name of the locale container for US-English is &quot;409&quot;). There are display specifier objects for different classes. A display specifier object has an attributeDisplayName attribute, which is a multivalued property that specifies the names to use in the UI for the attributes of the object class.

The following script binds to a displaySpecifier object for the User class and enumerates the attributeDisplayName collection. You should modify the code to bind to the displaySpecifier for the object class and locale of interest. 'These are the displaySpecifier objects that have 'attributeDisplayName set: 'cn=computer-Display 'cn=contact-Display 'cn=container-Display 'cn=default-Display 'cn=domainsDNS-Display 'cn=foreignSecurityPrincipal-Display 'cn=group-Display 'cn=msExchExchangeServer-Display 'cn=msExchProtocolCfgIMVirtualServer-Display 'cn=organizationalUnit-Display 'cn=pKICertificateTemplate-Display 'cn=printQueue-Display 'cn=publicFolder-Display 'cn=rpcContainer-Display 'cn=trustedDomain-Display 'cn=user-Display 'cn=volume-Display

Set objRoot = GetObject(&quot;LDAP://rootDSE&quot;) 'Modify the next line to match your locale and object class of interest. Set objDisplay = GetObject(&quot;LDAP://cn=user-display,cn=409,cn=displayspecifiers,&quot; & _                              objRoot.Get(&quot;configurationNamingContext&quot;))

attDisplayNames = objDisplay.GetEx(&quot;attributeDisplayNames&quot;)

WScript.Echo &quot;lDAPDisplayName&quot; & vbTab & &quot;U&C Label&quot; & vbCrLf & _ &quot;---&quot; & vbTab & &quot;---&quot;

For each value In attDisplayNames WScript.Echo Split(value, &quot;,&quot;, 2)(0) & vbTab & Split(value, &quot;,&quot;, 2)(1) Next

