#51646 - 2000-10-05 11:39 AM
creating list of domain members based on IP
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Hi all!!I am currently in the process of installing the SU service for admin purposes using a few scripts kindly written by Bryce. Nice one Bryce!!! The script requires a list of computers in the domain which I have got. But I don't wanna do it that way.....I wanna be difficult. I want to be able to create a list of computers in our domain based on IP e.g. 10.8.x.x. Why? well we have several offices spread across and the only thing that differenciates them is the IP and I want to do it office by office. I could do it over the WAN but I dont trust it. For example my office is 10.8.x.x and another office would be 10.2.x.x. I can post the code if you like but i'm sure youve seen it before.
Regards Ju [This message has been edited by Julian (edited 05 October 2000).]
|
|
Top
|
|
|
|
#51648 - 2000-10-05 03:52 PM
Re: creating list of domain members based on IP
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
|
|
Top
|
|
|
|
#51650 - 2000-10-05 04:05 PM
Re: creating list of domain members based on IP
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
|
|
Top
|
|
|
|
#51652 - 2000-10-05 04:37 PM
Re: creating list of domain members based on IP
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Now that looks more like what I want here. I'll have a little tinker with it and see what I can do.Cheers Ju
|
|
Top
|
|
|
|
#51653 - 2000-10-05 05:40 PM
Re: creating list of domain members based on IP
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
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).]
|
|
Top
|
|
|
|
#51654 - 2000-10-05 05:56 PM
Re: creating list of domain members based on IP
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Now that is something else, how long u been writing this stuff for man, top quality, hope I can do it sometime. But just one little thing. My clistip.dat is in the format: \\10.8.0.69 \\10.8.0.111 \\10.8.0.116 \\10.8.0.117 \\10.8.0.121 \\10.8.0.122 Can it be modified so its in the the format \\LINDA_HOLLAND \\FRANCINE_OGORMA \\SUSANB \\SUES_LAPTOP \\RICHARD_WOOLLEY \\GILL_MURPHY Regards Ju
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 581 anonymous users online.
|
|
|