Creating Analysis for Computers That have a certain Registry Key

(imported topic written by thesurg3on91)

I am looking to create an analysis that shows the computers that have the following value

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

ProxyEnable=1

How can i do this via the relevance?

(imported comment written by BenKus)

Check out: http://forum.bigfix.com/viewtopic.php?id=1187

So you will want to do something like:

exists value “ProxyEnable” whose (it = 1) of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry

Note this won’t work in the Relevance Debugger unless you do something like this: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=484

Ben

(imported comment written by thesurg3on91)

what i wrote was the following (ended up changing it to ProxyServer), but it gives the following return on computers in my analysis

either: error, or not reported

(exists logged on users) and (exists value “ProxyServer” of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry) and (value “ProxyServer” of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry = “someValueThatIWasSearchingFor”)

(imported comment written by thesurg3on91)

Nevertheless Ben,

thanks. I modified your suggestion above to include the ProxyServer and it is providing me the results I expected. I really appreciate your help. Have a great day.

(imported comment written by thesurg3on91)

I noticed that I need to check if the ProxyEnable is equal to 1 and if it is then is the ProxyServer value equal to “myvalue” then report True. If not, then report False.

Will this work? I cannot run it in my debugger to check.

if (exists value “ProxyEnable” whose (it = 1) of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry) and (exists value “ProxyServer” whose (it = “myvalue”) of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry) then “True” else “False”

(imported comment written by jessewk)

Anytime you find yourself writing a relevance clause in the form:

if (something) then “True” else “False”

You can always simplify your expression by removing the if statement and just returning a boolean instead.

For example, I would re-write your clause like this:

conjunction of ((exists value “ProxyEnable” whose (it = 1) of it AND exists value “ProxyServer” whose (it = “myvalue”) of it) of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry)

Not that yours won’t work, but why waste bytes and microseconds?

Jesse

(imported comment written by nickosan91)

hello - i am also looking to find a value which contains specific characters such as a 3 for the following key:

HKEY_LOCAL_MACHINE\SYSTEM\Setup\ with value “OEMDuplicatorString” I am a newby to bigfix and relevance language, I want to return TRUE or FALSE? Any suggestions? The “OEMDuplicatorString” is a Multi_String type.

(imported comment written by nickosan91)

I have used the following code:

if value “OEMDuplicatorString” of key “HKEY_LOCAL_MACHINE\SYSTEM\Setup” of registry as string contains “3.0” then (“SOE 3 detected”) else (“NON SOE”)

this seems to work however if the value does not exist I get an error… how do I add in another check for presence of value?

(imported comment written by nickosan91)

better still, how do i just dump the value?

(imported comment written by nickosan91)

if value “OEMDuplicatorString” of key “HKEY_LOCAL_MACHINE\SYSTEM\Setup” of registry as string contains “SOE” then (value “OEMDuplicatorString” of key “HKEY_LOCAL_MACHINE\SYSTEM\Setup” of registry as string) else (“NON SOE”)

This seems to do it! Now how do I filter OUT computers which are NON SOE using bigfix?

(imported comment written by BenKus)

In what way are you trying to filter them out? In a Fixlet? in the console?

Ben

(imported comment written by nickosan91)

Thanks Ben, have sorted it now, targeting automatic groups now based on relevance query.