' ------------------------------------------------------------------------- ' From the book Inside Active Directory, ISBN 0-201-61621-1 ' Copyright (C) 2002 by Addison-Wesley ' Script by Sakari Kouti (see http://www.kouti.com) ' You have a royalty-free right to use, modify, reproduce and distribute ' this script (and/or any modified version) in any way you find useful, ' provided that you agree that Addison-Wesley or Sakari Kouti has no ' warranty, obligations or liability for the script. If you modify ' the script, you must retain this copyright notice. ' ------------------------------------------------------------------------- Option Explicit Const ERROR_DS_NO_SUCH_OBJECT = &H80072030 Dim objDSE, objDispSpec, strName Dim wshArguments, arrNames, arrNames2, strGivenClass On Error Resume Next Set wshArguments = WScript.Arguments strGivenClass = wshArguments(0) Set objDSE = GetObject("LDAP://rootDSE") Err = 0 Set objDispSpec = GetObject("LDAP://CN=" & strGivenClass & _ "-Display,CN=409,CN=DisplaySpecifiers," & _ objDSE.Get("configurationNamingContext")) If Err = ERROR_DS_NO_SUCH_OBJECT Then WScript.Echo "No display specifier for class '" & strGivenClass & "'" WScript.Quit(1) End If arrNames = objDispSpec.Get("attributeDisplayNames") For Each strName In arrNames arrNames2 = Split(strName, ",", 2) WScript.Echo arrNames2(1) & vbTab & arrNames2(0) Next