Here is an example of retrieving this information using fnLDAPQuery()...

Code:

Call "fnLDAPQuery.kix"

$=SetOption("WrapAtEOL","on")
$=SetOption("NoVarsInStrings","on")
;$=SetOption("Explicit","on")

Dim $sWhat,$sFrom,$sFilter,$sScope,$aResults,$Result,$R,$

$sWhat = "ADsPath","Name","department","physicalDeliveryOfficeName"

$sFrom = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")

$sFilter = "(&(objectCategory=user)(Name=sh*))"

$sScope = "subtree"

$aResults = fnLDAPQuery($sWhat,$sFrom,$sFilter,"displayName ASC",$sScope)
@ERROR " : " @SERROR ?

For Each $Result in $aResults
If VarType($Result)>8192
For Each $R in $Result
$R ?
Next
Else
$Result ?
EndIf
Next