Welcome to KORG!!

I had to search the archives folder for this, but it's simple and effective:
 Code:
Break on

; Array of domains to query
$aDomains = "@DOMAIN", ''


For Each $Domain in $aDomains
 If $Domain
   "Processing " + $Domain ?

  $aList = GetMachineList($Domain)

  1 + Ubound($aList) " records found." ?
  For Each $Target in $aList
    $Target ?
  Next
 EndIf
Next




Function GetMachineList($DomainName)
	
  Dim $Machines[0], $iX
	
	
  ;Create domain object
  $Domain = GetObject("WinNT://" + $DomainName + ",domain")
	
  ;Set container object equal to domain object.
  $Container = $Domain
	
  ;Iterates through EVERY object in the domain.  Those
  ;objects that match the class are included in the array.
  $iX = -1
  For Each $Computer In $Container
	  
    If $Computer.Class = "Computer"
      $iX = $iX + 1
      ReDim Preserve $Machines[$iX]
      $Machines[$iX] = $Computer.Name
    EndIf
	  
  Next	

  ; Return the $Machines array...
  $GetMachineList = $Machines
	
  ;Object cleanup
  $Domain = 0
  $Container = 0
	
EndFunction
Glenn
_________________________
Actually I am a Rocket Scientist! \:D