Why not the enumOUs routine like what I use for computers in McAfee Manager. Look for UO's containing user accounts and populate a combobox with the hits

To move a user you don't need the source OU, just the destination.



Code:
break on

$l="LDAP://"+@domain+"/"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$ou = EnumOUs($l, 'user')
for each $item in split($ou,'|')
	? $item
next


Function EnumOUs($LDAP, $Filter)
     dim $aFilter[0], $pos,  $objOU, $i, $j

     if $Filter <> 'user'
          $Filter = 'computer'
          endif
     $objOU = GetObject($LDAP)
     if VarTypeName($objOU)='Object'
          $aFilter[0] = $Filter
          $objOU.Filter = $aFilter
          for each $item in $objOU
              ; $PBar1.Value = iif($PBar1.Value < $PBar1.Max,$PBar1.Value + 1,0)     ;for progress bar only
               if $item.class = $Filter
                    $i = $LDAP
                    endif
               next
          $aFilter[0] = "organizationalUnit"
          $objOU.Filter = $aFilter
          for each $item in $objOU
              ; $PBar1.Value = iif($PBar1.Value < $PBar1.Max,$PBar1.Value + 1,0)     ;for progress bar only
               $Name = $item.Name
               $pos = instrrev($LDAP,"/")
               $DN = Left($LDAP,$pos) + $Name + ", " + substr($LDAP, $pos+1)
               $j = EnumOUs($DN, $Filter)
               if $j
                    $i = iif($i,$i +"|"+ $j,$j)
                    endif
               next
          endif
      $EnumOUs = $i
     Endfunction
_________________________
How to ask questions the smart way <-----------> Before you ask