Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 11:48 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 28, 2010 11:56 pm 
Offline
Newbie

Joined: Thu Jan 28, 2010 2:09 am
Posts: 16
I found out if running audit.vbs on a 64-Bit machine, collecting software from another 64-Bit Windows returns only 32-Bit Software - regardless of requesting the software/uninstall hive or the 6432 hive. To make audit.vbs run on 32 and 64 Bit systems and also list 32- and 64 Bit Software the script must be changed.

The following example lists 32 AND 64 Bit Software regardless of being run on a 32 or 64 Bit Machine. It must somehow replace the "installed Software" section in audit.vbs.

[code]
strComputer = "."
Const HKLM = &h80000002
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", 32
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "32-bit Applications"
WScript.echo "-------------------"

Call GetApplications

objCtx.Add "__ProviderArchitecture", 64
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "64-bit Applications"
WScript.echo "-------------------"

Call GetApplications

Sub GetApplications

' Use ExecMethod to call the GetStringValue method
Set Inparams = objStdRegProv.Methods_("EnumKey").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"

set Outparams = objStdRegProv.ExecMethod_("EnumKey", Inparams,,objCtx)

For Each strSubKey In Outparams.snames

Set Inparams = objStdRegProv.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\" & strSubKey
Inparams.Svaluename = "DisplayName"
set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)

if ("" & Outparams.sValue) = "" then
'wscript.echo strSubKey
Else
wscript.echo Outparams.SValue
End iF

'Inparams.Svaluename = "QuietDisplayName"
'set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)
'wscript.echo Outparams.SValue

Next

End Sub
[/code]


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 07, 2010 3:04 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I would like to submit this as a possible solution.

[url]http://www.open-audit.org/phpBB3/viewtopic.php?f=10&t=3493#p15704[/url]

Can you try it?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group