Can I use PSTools to check for installed software using the reg keys?

I have installed Shockwave and Flash via GPO and am wondering if I can use PSTools to check the registry for the uninstall key to see how many installs have been done so far. I would like to do it by AD OU's if possible.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try the script below. When started without arguments, it will query you for the OU to process (requires dsquery.exe on the machine you're running the script on). Pass it the just the OU as in DirectParent/HigherOU/TopOU; you can leave out the DC part, it will be generated automatically.
It will create a csv report with a name based on the OU.
You can pass the script an existing report file as argument, and it will reprocess (only) those machines where the installs haven't been found yet.
@echo off
setlocal enabledelayedexpansion
set KeyList="Adobe Flash Player ActiveX" "Adobe Flash Player NPAPI" "Adobe Shockwave Player"
set ReportFolder=C:\Temp

set ReportHeader="Computer","Key","Installed","Error"
if not "%~1"=="" (
	if not exist "%~1" (
		echo Report file '%~1' not found.
		goto :eof
	set CsvFile=%~f1
	goto :Update
set OU=
echo Please enter the OU ^(no DC^), separated by '/'; example: Clients/Computers
set /p OU=OU: 
if "%OU%"=="" goto :eof
set DC=DC=%UserDNsDomain:.=,DC=%
set StartNode=OU=%OU:/=,OU=%,%DC%
set CsvName=%OU:/=_%.csv
set CsvFile=%ReportFolder%\%CsvName%
echo Starting search in '%StartNode%'.
>"%CsvFile%" echo %ReportHeader%
set QueryFailed=TRUE
for /f "tokens=2 delims=,=" %%a in ('dsquery.exe computer "%StartNode%"') do (
	for %%k in (%KeyList%) do (
		call :Process %%a "%%~k"
	set QueryFailed=FALSE
if /i "%QueryFailed%"=="TRUE" (
	del "%CsvFile%"
) else (
	echo Done; report written to '%CsvFile%'.
goto Done

echo Updating report '%CsvFile%'.
copy "!CsvFile!" "%Temp%\input.csv" >NUL
>"%CsvFile%" echo %ReportHeader%
for /f "skip=1 tokens=1-4 delims=," %%a in ('type "%Temp%\input.csv"') do (
	if not "%%~c"=="TRUE" (
		call :Process %%a %%b
	) else (
		>>"%CsvFile%" echo %%a,%%b,%%c,%%d
echo Done; updated report written to '%CsvFile%'.
del "%Temp%\input.csv"

goto :eof

set Computer=%~1
set Key=%~2
echo Processing %Computer%, '%Key%' ...
if "!AccessCache[%Computer%]!"=="OK" goto Query
if defined AccessCache[%Computer%] (
	>>"%CsvFile%" echo "%Computer%","%Key%","","!AccessCache[%Computer%]!"
	goto :eof
ping.exe -4 -n 2 %Computer% | find.exe /i "TTL" >NUL
if errorlevel 1 (
	>>"%CsvFile%" echo "%Computer%","%Key%","","Offline"
	set AccessCache[%Computer%]=Offline
	goto :eof
set Error=
for /f "delims=" %%a in ('reg.exe query "\\%Computer%\HKLM\Software" 2^>^&1 ^| find.exe /i "ERROR:"') do set Error=%%a
if not "%Error%"=="" (
	>>"%CsvFile%" echo "%Computer%","%Key%","","%Error%"
	set AccessCache[%Computer%]=%Error%
	goto :eof
set AccessCache[%Computer%]=OK
reg.exe query "\\%Computer%\HKLM\Software\Wow6432Node" >NUL 2>&1
if errorlevel 1 (
	set UninstallKey=\\%Computer%\HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\%Key%
) else (
	set UninstallKey=\\%Computer%\HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%Key%
reg.exe query "%UninstallKey%" >NUL 2>&1
if errorlevel 1 (set Installed=FALSE) else (set Installed=TRUE)
>>"%CsvFile%" echo "%Computer%","%Key%","!Installed!",""
goto :eof

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Newbie0000Author Commented:
Thanks so much for the info, I will give it a try.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.