Page 2 of 2 <12
Topic Options
#104972 - 2003-09-21 03:38 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
Ok, I see what you changed, but I'm still getting a missing parameter error on line 15.

Again, thank you so much for your help.

Top
#104973 - 2003-09-21 03:41 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, you could download a new version of the kixtart.
or at least tell me what version you actually have so I can change my code so it suites your version.
_________________________
!

download KiXnet

Top
#104974 - 2003-09-21 03:43 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
Sure, I downloaded the current release 4.21.
Top
#104975 - 2003-09-21 03:55 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, so updated the code above.
if you read what changed in line 15 and check the manual like I suggested in the beginning, you would have found it yourself.

anyway, this is the last code I attend to give you on silver platter with fries.
hopefully there is no need either.

[ 21. September 2003, 03:57: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#104976 - 2003-09-21 03:59 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
I know,I know I'm a welfare case. Thank you for your help. I did actually see that and tried it, but when I ran it it would create the file but not write any data. Still doing the same thing. Is this supposed to take a while to write actual data?
Top
#104977 - 2003-09-21 04:03 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ofcourse not.
think you forgot the UDF.
I didn't explain it either too well.

see on the faq How to use UDFs

for easy copy&paste (copying from board is pain) of the UDF, get it at: www.gwspikval.com/jooel/UDF

or alternatively from www.kixhelp.com
_________________________
!

download KiXnet

Top
#104978 - 2003-09-21 06:46 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
did I scare you away?

damn.
_________________________
!

download KiXnet

Top
#104979 - 2003-09-21 06:49 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
yeah. it's kind of overwhelming at this point. It's really kicking my head, but I hate to be a bother. Still reviewing, I'll let you know if I figure it out.
Top
#104980 - 2003-09-21 06:54 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nah, don't take it too hard.
anyway, I'd like to know does it work or not so ask you to try this and let me know:
;hotfix Scanner
;########################
$hotfix="KB824146"
$type="SP5" ; pre sp5 hotfix

$rc=open(1,"\\server\patch\"+$hotfix,5)
$regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows 2000\"+$type+"\"+$hotfix
for each $machine in netview2()
if "Windows 2000 Hotfix - KB824146"=ReadValue("\\"+$machine+"\"+$regkey, "Description")
$rc=writeline(1,$machine+","+ReadValue("\\"+$machine+"\"+$regkey, "InstalledDate")+@crlf)
else
$rc=writeline(1,$machine+",not installed"+@crlf)
Endif
next
$rc=close(1)

exit 0 ;script exits here.

;FUNCTION NetView2()
;
;AUTHOR Jens Meyer (sealeopard@usa.net)
;
;CONTRIBUTOR Shawn Tassie
;
;ACTION Enumerate all announced computers in your domain
;
;VERSION 1.2 (fixed bug in SHELL string)
; 1.1
;
;DATE CREATED 2002/05/14
;
;DATE MODIFIED 2003/05/31
;
;KIXTART 4.12+
;
;SYNTAX NetView2([Domain,Comment])
;
;PARAMETERS DOMAIN
; Specifies the domain to enumerate. If domain is omitted, returns a
; list of all announced computers in the current domain.
;
; COMMENT
; Optional boolean to determine whether to return the associated computer
; comment (separated by a comma from the computername)
;
;RETURNS An array of strings representing all the computers in the domain
;
;REMARKS This UDF returns a list of computers that are PINGable. Computers, that
; are members of the domain but are currently not connected to the domain,
; will not be listed. For a list of joined computers independent of whether
; they are on- or off-line use COMNetView().
;
; Slightly improved version of Shawn's NetView() UDF
; at http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=print_topic;f=12;t=000059
;
;DEPENDENCIES none
;
;EXAMPLE for each $computer in netview2()
; ? ''+$computer
; next
;
;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000202
;
function NetView2(optional $domain, optional $commentflag)
dim $array[255]
dim $redim, $i, $j, $tempfile
dim $filehandle, $retcode, $line
dim $name, $comment

$redim = 255
$i = 0
$j = 0
$tempfile = '%temp%\netview.tmp'

if $domain
$domain = '/domain:'+trim($domain)
endif

if vartype($commentflag)
$commentflag=val($commentflag)
else
$commentflag=0
endif

if exist($tempfile)
del $tempfile
endif

shell '%comspec% /c net view '+$domain+' >"'+$tempfile+'"'

if @error = 0
$filehandle=freefilehandle()
$retcode=open($filehandle,$tempfile)

for $j = 1 to 5
$line = readline($filehandle) ; skip headings
next

while @error = 0
$name= trim(substr($line,3,instr($line,' ')-1))
$comment = trim(right($line,len($line)-instr($line,' ')))
if $commentflag
$array[$i]=$name+','+$comment
else
$array[$i]=$name
endif
$i=$i+1
if $i = $redim
$redim=$redim*2
redim preserve $array[$redim]
endif
$line = readline($filehandle)
loop
$retcode=close($filehandle)
del $tempfile
if $i
redim preserve $array[$i-4]
$netview2 = $array
exit @error
endif
endif

$netview2 = 0
exit @error
endfunction


[ 21. September 2003, 06:56: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#104981 - 2003-09-21 07:16 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
Worked like a champ. I don't know how to thank you. Can you tell me how it knows to scan the whole network? I only got results for about 1/3 of the machines on my network. You've done more than enough for me, so please don't even bother with why, just want to know where that network part is defined. I'll look at the rest.

Again, thank you so much for your kindness.

Top
#104982 - 2003-09-21 07:24 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
where?
in your wins/PDC/...

fire up cmd.exe and execute net view

it scans all your domain but like previously said, this does not work with computers turned off.
if you want to see those too, you need to turn them on, maybe with WakeOnLan.
but that's totally another thing.

oh, if you have multiple domains, you need to call each separately like descriped in netview2()'s header documentation.
_________________________
!

download KiXnet

Top
#104983 - 2003-09-21 07:28 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
yeah, I did that and the numbers match. I'll try the bdc's as well.

thanks. again.

Top
#104984 - 2003-09-21 07:37 AM Re: Registry Search Output
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
what numbers?
as I look my net view, it's pretty straight forward. and so is the netview2(), so there is no problem.

also, as I made it write not reachable/installed too to file, there should be all machines...

weird...
_________________________
!

download KiXnet

Top
#104985 - 2003-09-21 07:40 AM Re: Registry Search Output
RVS42 Offline
Fresh Scripter

Registered: 2003-09-20
Posts: 17
I dumped the results into an excel spreadsheet, and ran that against all DCs. Everything looks in order. I agree... weird.
Top
#104986 - 2003-09-21 06:04 PM Re: Registry Search Output
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
quote:
Is this supposed to take a while to write actual data?
Depends on the size of your Network.

On my Network it would take a couple minutes before attempting to write, then would take HOURS to complete the writing.

Don't worry RVS42 it will become easier the more you use/read/learn/experiment with KiXtart. [Big Grin]

Top
Page 2 of 2 <12


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.065 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org