Analyses Help - If reg has specific value then true

(imported topic written by RobertDiRosato)

Hello,

I am trying to configure and analyses and in one of my columns I would like to.

Have it look for a specific value of a registry key if it exists then true if not then false.

I was trying something like this:

if (exists value “TestValue” of keys “HKEY_CURRENT_USER\TestKey” of registry) AND (it contains “TestData”) then “Yes” else “No”

In a nutshell I want it to look into the data of a value and if the data is there then yes

Below are a couple I have working already if anyone is interested.

If either of the 2 folders exist Then YES

if (exists folder “C:\Program Files (x86)\IBM\Lotus”) or (exists folder “C:\Program Files\IBM\Lotus”) then “Yes” else “No”

If both of the folders exist then YES

if (exists folder “C:\Program Files (x86)\IBM\Lotus”) and (exists folder “C:\Program Files\IBM\Lotus”) then “Yes” else “No”

If registry key is present then YES

if (exists value “ProductName” of keys “HKEY_CLASSES_ROOT\Installer\Products\717AF7A29B5F303489661F1CF60984E2” of registry) then “Yes” else “No”

If registry key is present return it’s value else display N/A

if (exists value “ProductVersion” of keys “HKEY_CURRENT_USER\Software\Microsoft\Communicator” of registry) then (values “ProductVersion” of key “HKEY_CURRENT_USER\Software\Microsoft\Communicator” of registry as string) else “N/A”

(imported comment written by SystemAdmin)

I didn’t think that the HKEY_Current_User key existed for the BESClient since it runs under the SYSTEM context.

You can query the HKEY_USERS key. Below is a retrieved property I use to locate users who have installed DropBox under their Profile.

if (exists values “InstallLocation” of keys “Software\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox” of keys of key “HKEY_USERS” of registry) then (“Installed”) else “N/I”

(imported comment written by RobertDiRosato)

Tim,

I think you misunderstood my question… But thanks for the reply.

If you read my post I have an example that shows you how to look for a value of a key.

My question is:

How can Read the data of a value and based on the data say true or false…

Example

Say you want to look for all users who have dropbox 4.2 and display true or false

This would display True

KEY: hkey_users\Software\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox

VALUE: Version

DATA: 4.2

This would display False

KEY: hkey_users\Software\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox

VALUE: Version

DATA: 1.0

(imported comment written by NoahSalzman)

q: value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server” of registry

A: 8.2.1093.0

q: (value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server” of registry) = “8.2.1093.0”

A: True

(imported comment written by RobertDiRosato)

Noah,

Thanks for the reply.

I wrote it like this but it still did not work,

If (value “UserAuthentication” of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp” of registry) = “1” Then “True” Else “False”

It’s a Hexadecimal DWOORD Value 32bit. Not sure if that makes a difference.

(imported comment written by jeremylam)

The inspector “value … of key … of registry” returns a “registry key value” type which is different than a string. It needs to be cast to a string before it can be compared to a string.

q: value 
"DeploymentType" of key 
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient\Office2003Control" of registry A: 3 T: 0.046 ms I: singular registry key value   q: (value 
"DeploymentType" of key 
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient\Office2003Control" of registry) as string A: 3 T: 0.056 ms I: singular string   q: (value 
"DeploymentType" of key 
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient\Office2003Control" of registry) = 
"3" A: False T: 0.055 ms I: singular 

boolean   q: ((value 
"DeploymentType" of key 
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient\Office2003Control" of registry) as string) = 
"3" A: True T: 0.070 ms I: singular 

boolean