Hi,

you can do what you want with fnLDAPQuery function :
 Code:
break on

". searching user" ?
$what = "samAccountName", "displayname"
$from = "LDAP://OU=xxxx,OU=xxxx,OU=xxxx,DC=xx,DC=xx"
$sFilter = "(&(objectCategory=person)(objectClass=user))"

$arr = fnLDAPQuery( $What, $from, $sFilter, "samAccountName", "onelevel" )
if @error
	"  error in the LDAP request" ?
else
	"  found : " (UBound($arr)+1) ?

	". results" ?
	for $i = 0 to UBound($arr)
		for $j = 0 to UBound($arr,2)
			$arr[$i,$j] ";"
		next
		?
	next
endif

"== ended ==" ?
gets $x
exit 0
 
Function fnLDAPQuery($What,Optional $From, Optional $sFilter, Optional $OrderBy, Optional $Scope, Optional $User, Optional $Pswd)
...
...
endfunction 

There are two important points :
- $from is the distinguishedname of the OU prefixed with LDAP://
- $scope is set to "onelevel" to get object contained in the OU

if you want to get user in "Users", take care that Users is not an OU.
distinguished name is CN=Users,DC=xxx,DC=xx
so $from should be "LDAP://CN=Users,DC=cus,DC=fr"
_________________________
Christophe