' ------------------------------------------------------------------------- ' 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 Dim wshArguments, objClass, strPropName, strGivenClass, i Set wshArguments = WScript.Arguments On Error Resume Next strGivenClass = wshArguments(0) On Error Goto 0 'resume normal error handling If strGivenClass = "" Then WScript.Echo "Enter a class LDAP name as an argument" WScript.Quit(1) End If Set objClass = GetObject("LDAP://schema/" & strGivenClass) i = 0 For Each strPropName In objClass.MandatoryProperties i = i + 1 WScript.Echo "Man " & i & ": " & strPropName Next i = 0 For Each strPropName In objClass.OptionalProperties i = i + 1 WScript.Echo "Opt " & i & ": " & strPropName Next