Page 1 of 1 1
Topic Options
#61939 - 2002-01-09 10:00 AM Search in remote Registry (4 Levels deep)
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hi all,

and then came the time when i was strucked by inventory needs ....

Here is one for the pro's :

need to evaluate (amongst others) the type of Backup device which is located in
\\[Server]\HKLM\HARDWARE\DEVICEMAP\SCSI\???(SCSI Port n)\???(SCSI Bus n)\???(Target ID n)\???(Logical Unit ID n)\Identifier

A search Criteria is where DeviceName = Tape0 , Identifier equals the Tape Device type ...

Tried kinda recursive enumkey() with 4d arrays and 4 single dimension arrays ... no luck by now

If anyone wants to help or has a better way of getting this Info ... it would be highly appreciated

J.

_________________________



Top
#61940 - 2002-01-09 11:16 AM Re: Search in remote Registry (4 Levels deep)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
4d arrays?
Jpols, I know you want to do everything the hardway, but if I understood, all you need to do is search the registry subtree
\\[Server_name_or_ip]\HKLM\HARDWARE\DEVICEMAP\SCSI

with enumkey it is searchable, but where do you need this array?

_________________________
!

download KiXnet

Top
#61941 - 2002-01-09 11:52 AM Re: Search in remote Registry (4 Levels deep)
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
jpols,
When reaching it manually, do you find it ?
if yes, can you post tbe complete path ?
_________________________
? getobject(Kixtart.org.Signature)

Top
#61942 - 2002-01-09 02:56 PM Re: Search in remote Registry (4 Levels deep)
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Sure Alex ,
The complete path is (depends on Hardware setup) stated above and ends with Valuename 'Identifier' which contains fe. "Quantum DLT etc."

Lonkero,

The problem is that it is for sure different on 245 Servers (The Keys can be different are the ones with Question marks above ) !

Thanks for even look at it

Jochen

[ 09 January 2002: Message edited by: jpols ]

_________________________



Top
#61943 - 2002-01-09 04:23 PM Re: Search in remote Registry (4 Levels deep)
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
OUCH,

Lonkero , you were right: simply 'enumkey'
is in the mean time replaced by 'regfind.exe'
(NT Server ResKit !)

Someday I have to start thinking more about doin' it the easy way , i'm such a DOH-head !

J.

_________________________



Top
#61944 - 2002-01-09 04:36 PM Re: Search in remote Registry (4 Levels deep)
Anonymous
Unregistered


Condolences Jpols, from the man who spent several hours this morning tring to write a script that would edit ACL lists down a directory tree without overwriting the existing permissions.by 11am I was pulling my hair out and someone wandered over and said did you know CACLS.exe does that?
Top
#61945 - 2002-01-09 05:53 PM Re: Search in remote Registry (4 Levels deep)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jpols,
still can't get the reason for array.
Would be helpfull to see your script part.
Anyway, why don't you do something like (not really tested, just pulling out from my head):
code:

$i=0
$portkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI",$i)
while len($portkey)
$i2=0
$buskey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey",$i2)
while len($buskey)
$i3=0
$targetkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey\$buskey",$i3)
while len($targetkey)
$i4=0
$unitkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey\$buskey\$targetkey",$i4)
while len($unitkey)
$value = readvalue("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey\$buskey\$targetkey\$unitkey","DeviceName")
if len("$value") $value ? endif
$i4 = $i4+1
$unitkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey\$buskey\$targetkey",$i4)
loop
$i3=$i3+1
$targetkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey\$buskey",$i3)
loop
$i2=$i2+1
$buskey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI\$portkey",$i2)
loop
$i=$i+1
$portkey = enumkey("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SCSI",$i)
loop

or have I misunderstood your question?

_________________________
!

download KiXnet

Top
#61946 - 2002-01-09 06:33 PM Re: Search in remote Registry (4 Levels deep)
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hey Lonkero,

that does the trick (at least it displayed all Identifier strings on my Box )

Will adapt for my needs and see which way is faster ... regfind or yours (No, I won't build a public udf around this ! )

cheers !


John, I know how this feels !

[ 09 January 2002: Message edited by: jpols ]

_________________________



Top
#61947 - 2002-01-09 06:39 PM Re: Search in remote Registry (4 Levels deep)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jpols,
how you check which is faster?
ain't kix-solution allways the better one?

hmm...
haven't actually used regfind...
can you specify subkeys to search in or just the main keys?
if it scans the whole HKLM-key it should be slower.

and if it is, I might write a udf around this.

_________________________
!

download KiXnet

Top
#61948 - 2002-01-10 01:05 AM Re: Search in remote Registry (4 Levels deep)
Anonymous
Unregistered


Jpols,

Here is the solution to your problem !
http://users.otenet.gr/~novastar/scripts/storage_list.zip

[ 10 January 2002: Message edited by: novastar ]

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.061 seconds in which 0.029 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