You could enumerate the properties. It's not as nicely categorised as your example, but it does pick up all the attributes and saves a lot of typing.
I left out the code to recursively expand objects and arrays as an exercise for the reader.
Code:
Break ON
$=SetOption("WrapAtEOL","ON")
$sUserName = "rhowarth"
$asUserHome = TranslateName (3, "", 3, @LDomain+"\"+$sUserName, 1)
$oUserInfo = GetObject("LDAP://" + $asUserHome[0])
$oUserClass = GetObject($oUserInfo.schema)
$iMaxLen=0
$sPropertyList=""
; Collate properties and determine max length to tidy up the display
For Each $sProperty in $oUserClass.MandatoryProperties
If Len($sProperty)>$iMaxLen $iMaxLen=Len($sProperty) EndIf
$sPropertyList=$sPropertyList+@CRLF+$sProperty
Next
For Each $sProperty in $oUserClass.OptionalProperties
If Len($sProperty)>$iMaxLen $iMaxLen=Len($sProperty) EndIf
$sPropertyList=$sPropertyList+@CRLF+$sProperty
Next
$iMaxLen=$iMaxLen+1
While Len($sSpacer)<$iMaxLen $sSpacer=$sSpacer+" " Loop
; Sort and enumerate the properties
For Each $sProperty in QS(Split(SubStr($sPropertyList,3),@CRLF))
If Instr($sProperty,"-") ; Skip properties that will cause KiXtart parser problems
Left($sProperty+$sSpacer,$iMaxLen)+"N/A"+@CRLF
Else
$=Execute("$$sVarType=VarTypeName($$oUserInfo."+$sProperty+")")
$=Execute("$$sVarValue=$$oUserInfo."+$sProperty)
Left($sProperty+$sSpacer,$iMaxLen)+Left($sVarType+$sSpacer,11)
Select
Case $sVarType="String"
$sVarValue
Case $sVarType="long"
$sVarValue
EndSelect
@CRLF
EndIf
Next
Exit 0
; TranslateName function authored by Howard A. Bullock
Function TranslateName ($InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType)
Dim $InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType
Dim $NameTranslate, $ReturnName, $Error, $ErrorText
$Error = 0
$ErrorText = ""
$ReturnName = ""
$NameTranslate = CREATEOBJECT ("NameTranslate")
$Error = @error
$ErrorText = @serror
if $Error = 0
$NameTranslate.Init ($InitType, $BindName)
$Error = @error
$ErrorText = @serror
if $Error = 0
$NameTranslate.Set ($LookupNameType, $LookupName)
$Error = @error
$ErrorText = @serror
if $Error = 0
$ReturnName = $NameTranslate.Get($ReturnNameType)
$Error = @error
$ErrorText = @serror
endif
endif
endif
$TranslateName = $ReturnName, $Error, $ErrorText
Endfunction
; BrianTX's Qsort.
function qs($a)
DIM $b[32],$c[32],$d,$e,$f,$g,$h,$i,$j,$k,$l
$b[0]=0
$c[0]=UBOUND($a)
$d=0
While $d >=0
$e=$b[$d]
$f=$c[$d]
While $e < $f
$h=$e+($f-$e)/2
$k=$a[$e]
$A[$e]=$A[$h]
$A[$h]=$k
$i=$e+1
$j=$f
$l=0
Do
While ($i<$j) AND $A[$e] > $A[$i]
$i=$i+1
Loop
While ($j>=$i) AND $A[$j] > $A[$e]
$j=$j-1
Loop
IF $i>=$j
$l=1
ELSE
$k=$A[$i]
$A[$i]=$A[$j]
$A[$j]=$k
$j=$j-1
$i=$i+1
ENDIF
Until $l=1
$k=$a[$e]
$a[$e]=$a[$j]
$a[$j]=$k
$g=$j
If $g-$e <= $f - $g
If $g+1 < $f
$b[$d]=$g+1
$c[$d]=$f
$d=$d+1
Endif
$f=$g-1
Else
If $g-1 > $e
$b[$d]=$e
$c[$d]=$g-1
$d=$d+1
Endif
$e=$g+1
Endif
Loop
$d=$d-1
Loop
$qs=$a
Endfunction