Solved

Run a script to find a registry entry on remote computers?

Posted on 2008-10-20
8
725 Views
Last Modified: 2012-05-05
Greetings Experts!

I have a 200+ Windows XP/2003 AD domain in which I recently used a group policy to install Adobe Active-x player on the users pc's.  After running an inventory update on SpiceWorks, only 53 of the 200 show up as having the software installed.  Yet I have verified at least 5 others that have the software installed and are not showing up in SW.

So, I want to run a script that will find the app code {AC76BA86-7AD7-1033-7B44-A9000000000} in the registry of the computers listed in a text file.  The problem is, I have no idea how to make this happen.  My scripting skills are novice at best so if you post a suggestion, please provide it with some help or be willing to answer some newb questions.

Thanks in advance!
0
Comment
Question by:samiam41
  • 5
  • 2
8 Comments
 
LVL 8

Expert Comment

by:DenverRick
ID: 22759102
You would probably have to buy one of the many utilities available for registry work...or you could create a script in Group Policy that runs at logon, that uses the reg command to query the local registry and port the results to a file (on a server) named with the local machine name.
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 22759414
Paste the script below into a text file with a .cmd extension.  Customize the value of the key variable with the location of the registry key to check for.  Running the script will check for the existence of the key on all computers in computerlist.txt and output the results to log.csv.


@echo off

setlocal
 

set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A9000000000}

set log=log.csv
 

for /F %%G in (computerlist.txt) do (

 reg query "\\%%G\%key%" > NUL 2>&1

 if errorlevel 1 (echo %%G,no>>"%log%") else (echo %%G,yes>>"%log%")

)

Open in new window

0
 
LVL 9

Author Comment

by:samiam41
ID: 22759574
Thanks for the posts.

@ Shift-3 >  That is what I was looking for.  I will test it out now and let you know the results.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22759946
How do I specify where the computerlist.txt file is located or where does the script believe it should be located?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 9

Author Comment

by:samiam41
ID: 22759972
never mind.  I figured it out.  Thanks
0
 
LVL 9

Author Comment

by:samiam41
ID: 22759991
DUDE!!  That is seriously one of the COOLEST scripts I have seen.  Maybe I am just easily amazed but man that makes it easy to use and understand the results.  YES!  

Can I modify that to detect other apps as long as I change the app code??
0
 
LVL 38

Expert Comment

by:Shift-3
ID: 22760230
Yes, just change the value of the key variable.
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 31507867
I know that must have been painfully easy for you but your answer proved invaluable for me.  Thanks again for your help.

Regards,
Aaron
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now