here ya go!

clist_by_ip.kix

code:

break on cls
;--------------------------------------------------------------------------
; This script will create a list of all NT computers ip# that are using DHCP
; and are in your domain. the file global.exe and dhcpcmd.exe is needed
; for this script to work.
;--------------------------------------------------------------------------


$tempfile = "%temp%\kix.tmp"
$outfile = "clistip.dat"
$domain = "<domain>"
$subnet = "10.2.0.0"
$DHCPServer = "10.2.0.234"


;--------------------------------------------------------------------------
$cr = chr(13)+chr(10)
$computername = ""
$subnetmask = substr("$subnet",1,instr("$subnet",".0"))
Gosub get_computername

? "Collecting data from DHCP Server($DHCPserver)"
shell '%comspec% /c dhcpcmd $DHCPServer enumclients $subnet | find "$subnetmask" > $tempfile'
$nul = open(1,$tempfile,2)
$data = readline(1)
if exist("$outfile") = 1 del $outfile endif
$nul = open(2,"$outfile",5)
? "writing $outfile"
do
$DHCPIP = rtrim(substr("$data",instr("$data","$subnetmask"),17))
$data = ltrim(substr("$data",20,len("$data")))
$DHCPcname = rtrim(substr("$data",1,instr("$data"," ")))
select
case instr("$computername","$dhcpcname") <> 0
$nul = writeline(2,"\\$dhcpcname$cr") "."
endselect
$data = readline(1)
until @error <> 0
$nul = close(1)
$nul = close(2)
del $tempfile


Exit
;--------------------------------------------------------------------------


:get_computername
? "Collecting all NT Computer Name's in Domain($domain)"
shell '%comspec% /c global "domain Users" "$domain" | find "$" > $tempfile'
$nul = open(1,$tempfile)
$temp = readline(1)
do
$computername = $computername + substr($temp,1,len($temp)-1) + ","
$temp = readline(1)
until @error <> 0
$nul = close(1)
del $tempfile
return


Bryce

[This message has been edited by Bryce (edited 05 October 2000).]