Hi Bryce,

A while back you sent me a fine piece of code to extract a list of NT computers in a domain based in IP. I needed the script the distribute the SU service to each site and it worked a treat. Thanks very much Bryce . Heres the code just to recap your memory:

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 = "e:\my_scripts\su\ilford.dat"
$domain = "THOMPSONS"
$subnet = "10.2.0.0"
$DHCPServer = "10.2.0.30"


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

shell '%comspec% /c dhcpcmd $DHCPServer enumclients $subnet | find "$subnetmask" > $tempfile'
$nul = open(1,$tempfile,2)
$data = readline(1)
if exist("$outfile") = 1 del $dumfile 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
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


Could this code be modified at all so the outfile would show computer name then IP address next to it. e.g.

Computer name IP Address
\\JULIANS 10.2.0.3

I've tried to have a go myself but to be honest its all a bit too daunting for me. I am getting a little better though at the KIX thing.

Anyway can Bryce or anyone give me a hand at all. Any help much appreciated.

Ju