'###### Configuration ###### RootDCInfo = "DC=YourDomain,DC=lab" 'Forest root domain TargetFile = "c:\temp\attributes.csv" '###### Configuration ###### Set objAttributeSC = GetObject _ ("LDAP://cn=schema,cn=configuration," & RootDCInfo) call GenCSV("Attribute,Display,Single-valued,Datatype,system-Only,Linked",TargetFile) For Each objItem in objAttributeSC GetAttrData(objItem.Name) Next sub GetAttrData(attr) Set objAttribute = GetObject _ ("LDAP://" & attr & ",cn=schema,cn=configuration," & RootDCInfo) Wscript.Echo "Attribute: " & attr Wscript.Echo "Single-valued: " & objAttribute.isSingleValued Select Case objAttribute.oMSyntax Case 1 Wscript.Echo "Datatype: " & "Boolean" AttrType = "Boolean" Case 2 Wscript.Echo "Datatype: " & "Integer or Enumeration" AttrType = "Integer or Enumeration" Case 4 Wscript.Echo "Datatype: " & "String (Octet or SID)" AttrType = "String (Octet or SID)" Case 6 Wscript.Echo "Datatype: " & "String (Object-Identifier)" AttrType = "String (Object-Identifier)" Case 10 Wscript.Echo "Datatype: " & "Integer or Enumeration" AttrType = "Integer or Enumeration" Case 18 Wscript.Echo "Datatype: " & "String (Numeric)" AttrType = "String (Numeric)" Case 20 Wscript.Echo "Datatype: " & "Case-Ignore String (Teletex)" AttrType = "Case-Ignore String (Teletex)" Case 27 Wscript.Echo "Datatype: " & "Case-Sensitive String" AttrType = "Case-Sensitive String" Case 19 Wscript.Echo "Datatype: " & "String (Printable or IA5)" AttrType = "String (Printable or IA5)" Case 22 Wscript.Echo "Datatype: " & "String (Printable or IA5)" AttrType = "String (Printable or IA5)" Case 23 Wscript.Echo "Datatype: " & "String (UTC-Time or Generalized-Time)" AttrType = "String (UTC-Time or Generalized-Time)" Case 24 Wscript.Echo "Datatype: " & "String (UTC-Time or Generalized-Time)" AttrType = "String (UTC-Time or Generalized-Time)" Case 64 Wscript.Echo "Datatype: " & "String (Unicode)" AttrType = "String (Unicode)" Case 65 Wscript.Echo "Datatype: " & "Large Integer" AttrType = "Large Integer" Case 66 Wscript.Echo "Datatype: " & "String (NT Security Descriptor)" AttrType = "String (NT Security Descriptor)" Case 127 Wscript.Echo "Datatype: " & "Object" AttrType = "Object" Case Else Wscript.Echo "Datatype: " & "Undefined" AttrType = "Undefined" End Select if (IsNull(objAttribute.linkID) or objAttribute.linkID="" or objAttribute.linkID="") then Linked = "No" else Linked = "Yes" end if call GenCSV (attr & "," & objAttribute.lDAPDisplayName & "," & objAttribute.isSingleValued & "," & AttrType & "," & objAttribute.systemOnly & "," & Linked, TargetFile) end sub sub GenCSV(Wline,strFile) Const ForAppending = 8 set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile(strFile, ForAppending, True) objFile.WriteLine(Wline) objFile.Close end sub