Thanks Glenn and Lonkero; here is the updated code that will get a list of domain computers without being on a domain computer

 Code:
Function GetMachineList($DomainName, $DomainUser, $DomianPass)
	
  Dim $Machines[0], $iX
	
	
  ;Create domain object
  $Domain = GetObject("WinNT:").OpenDSObject("WinNT://$DomainName" , $DomainUser, $DomainPass, 1)
	
  ;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


Edited by Iz3k34l (2016-04-10 02:34 AM)