INFO: Determine the lDAPDisplayName for an Attribute (290999)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Active Directory Services Interface, System Component
  • Microsoft Active Directory Services Interface, Microsoft Active Directory Client

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 "409"). 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("LDAP://rootDSE")
'Modify the next line to match your locale and object class of interest.
Set objDisplay = GetObject("LDAP://cn=user-display,cn=409,cn=displayspecifiers," & _
                               objRoot.Get("configurationNamingContext"))

attDisplayNames = objDisplay.GetEx("attributeDisplayNames")

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

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

REFERENCES

ADSI Open Interfaces for Managing and Using Directory Services
http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/windows2000serv/deploy/w2kadsi.asp

Display Specifiers
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/ad/display_specifiers.asp

For more information on useful Lightweight Directory Access Protocol (LDAP) directory tools, download the following white paper:

Toolbox for LDAP Directory Application Developers (Microsoft Windows 2000 version)
LDAP toolbox white paper.doc


Modification Type:MinorLast Reviewed:3/19/2004
Keywords:kbDSWADSI2003Swept kbDSWADSI2003Swept kbinfo KB290999