Extract Registry Key

  • Thread starter Thread starter jayloveroni
  • Start date Start date
J

jayloveroni

I would like to extract the value of one registry key for
all computers in my NT Domain, consisting of mainly Win 2K
clients. I am planning on using a batch file, but don't
know if there is a command to extract the specified
registry key and append it to a text file.

I will be using the extracted data to compare the keys and
ensure there are no duplicates.

Please let me know how I can do this.

Thanks in advance
 
jayloveroni wrote in
I would like to extract the value of one registry key for
all computers in my NT Domain, consisting of mainly Win 2K
clients. I am planning on using a batch file, but don't
know if there is a command to extract the specified
registry key and append it to a text file.

I will be using the extracted data to compare the keys and
ensure there are no duplicates.

Please let me know how I can do this.

At the local machine or centrally? More on what you want to do and
how would help.

A start is
regedit /e "<Drive:>\FolderName\FileName.reg" "KeyPath"

reg.exe psexec.exe
 
I use a for loop to pull machine names from a text file, then use the
following line (using reg.exe v2.0 fom the resource kit) It's all one line.

for /f "skip=4 delims= tokens=3" %%A in ('reg query
"\\%1\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon" /V DefaultUsername') do set DEFUN=%%A

that will grab the value for "DefaultUsername", set the variable DEFUN to
its value, then you can write it to a text file elsewhere in your batch:

@echo %1;%DEFUN%>>results.txt

That line will write the machine name and default user to a text file.

Scott
 
Sorry, not exactly sure about what your start will do,
but here is some more information.

Many of the systems in our domain have software loaded
that requires a unique identifier, similar to a SID.
Software such as Symantec AV and SMS from microsoft each
have unique GUIDs for their clients. Unfortunately, if
there are duplicate GUIDs in a domain, meaning clients
are sharing the same identifier, then only ONE will show
as being a client at any time, hindering the purpose of
the software.

What I intend to do is create a batch file to go to each
client, find the registry path I specify that stores the
unique ID, and copy that to a text file. From there I
plan to run a query for any duplicates.

That is just an idea, but I need to know if there is a
registry hack command that will copy the key.

jjs
 
jayloveroni wrote in
Sorry, not exactly sure about what your start will do,
but here is some more information.

Many of the systems in our domain have software loaded
that requires a unique identifier, similar to a SID.
Software such as Symantec AV and SMS from microsoft each
have unique GUIDs for their clients. Unfortunately, if
there are duplicate GUIDs in a domain, meaning clients
are sharing the same identifier, then only ONE will show
as being a client at any time, hindering the purpose of
the software.

What I intend to do is create a batch file to go to each
client, find the registry path I specify that stores the
unique ID, and copy that to a text file. From there I
plan to run a query for any duplicates.

That is just an idea, but I need to know if there is a
registry hack command that will copy the key.

Well that's just what I provided (I think). Not a "hack" at all just
uses the regedit.exe that already exists on the client systems. You
may need to be logged on with administrator authority though to use
it. Since you have not specified the key it is unclear whether a
User account can read the values there.

This
regedit /e "<Drive:>\FolderName\FileName.reg" "KeyPath"
will read the key (keypath) and store the results in the file
(filename.reg). Try it.

reg.exe is another commandline tool that can read the registry and is
included in the W2K Support Tools (installable from the CD)

psexec.exe is a free tool (Sysinternals.com) that might facilitate
your making the queries remotely.

If you need help with the actual Batch File, then I suggest a batch
language/command prompt group such as
microsoft.public.win2000.commandprompt.admin
 
Back
Top