Serial monitor no results on vmware

(imported topic written by var91)

hi,

this code works fine, but if I run this on a vmware virtual client i get no result back

((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

I need a “n/a” if no monitor is found on the computer.

I know it should be easy, but i am no very good in the relevance language now…but I am learning…

Please for help.

Thanks Andi

(imported comment written by Lee Wei)

This takes you down a different path.

This is a statement that I use. Maybe you can check to see if it works better for your deployment.

if (exists key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY” of registry) then (((if ((last 8 of first 152 of (value “EDID” of key “Device Parameters” of it as string) = “000000ff”)) then (hexadecimal string (last 24 of first 178 of (value “EDID” of key “Device Parameters” of it as string))) else “n/a”)) of keys whose ((exists key “Control” of it) and (exists key “Device Parameters” of it) and (exists value “EDID” of key “Device Parameters” of it)) of keys whose (name of it does not contain “Default_Monitor”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY” of registry) else (“n/a”)

Lee Wei

(imported comment written by var91)

hi,

thanks, but I get the same result on vmware computers as in my relevance , i want to get back “N/A”

This are my registry entries on a vmware virtual client (Windows 7)

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\4&10c2e2d6&0&UID0

“DeviceDesc”="@monitor.inf,%nonpnpmonitor.devicedesc%;Nicht-PnP-Monitor (Standard)"

“Capabilities”=dword:000000e4

“ConfigFlags”=dword:00000000

“HardwareID”=hex(7):4d,00,4f,00,4e,00,49,00,54,00,4f,00,52,00,5c,00,44,00,65,\

00,66,00,61,00,75,00,6c,00,74,00,5f,00,4d,00,6f,00,6e,00,69,00,74,00,6f,00,\

72,00,00,00,00,00

“CompatibleIDs”=hex(7):2a,00,50,00,4e,00,50,00,30,00,39,00,46,00,46,00,00,00,\

00,00

“ContainerID”="{a38bc5b6-bd04-11e0-98e6-b1f7c1afb951}"

“ClassGUID”="{4d36e96e-e325-11ce-bfc1-08002be10318}"

“Driver”="{4d36e96e-e325-11ce-bfc1-08002be10318}\0000"

“Security”=hex:01,00,04,90,00,00,00,00,00,00,00,00,00,00,00,00,14,00,00,00,02,\

00,60,00,04,00,00,00,00,00,14,00,00,00,00,10,01,01,00,00,00,00,00,05,12,00,\

00,00,00,00,18,00,00,00,00,10,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,\

00,01,00,18,00,00,00,00,10,01,02,00,00,00,00,00,05,20,00,00,00,2b,02,00,00,\

00,00,14,00,00,00,00,10,01,01,00,00,00,00,00,05,04,00,00,00

“Class”=“Monitor”

“Mfg”="@monitor.inf,%generic%;(Standardmonitortypen)"

“Service”=“monitor”

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\4&10c2e2d6&0&UID0\Device Parameters

“BAD_EDID”=hex:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\4&10c2e2d6&0&UID0\LogConf

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\4&10c2e2d6&0&UID0\Control

“ActiveService”=“monitor”

Is it possible to make i IF clause around my relevance, e.g

string value of select “Model from Win32_ComputerSystem” of wmi as string as trimmed string = “VMware Virtual Platform”

on VMware ist TRUE, on others FALSE.

I tried this, but it doesnt work. Do you have another idea?

Thanks Andi

(imported comment written by Lee Wei)

When a statement returns an empty string, the Console displays it as .

So we can try checking for that.

(if (it = “”) then (“N/A”) else (it)) of concatenation "; " of (if (exists key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY” of registry) then (((if ((last 8 of first 152 of (value “EDID” of key “Device Parameters” of it as string) = “000000ff”)) then (hexadecimal string (last 24 of first 178 of (value “EDID” of key “Device Parameters” of it as string))) else “N/A”)) of keys whose ((exists key “Control” of it) and (exists key “Device Parameters” of it) and (exists value “EDID” of key “Device Parameters” of it)) of keys whose (name of it does not contain “Default_Monitor”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY” of registry) else (“N/A”))

(imported comment written by var91)

Ok thank, your relevance works, i try this if with my relevance but this doesnt work ???

(if (it = “”) then (“N/A”) else (it)) of concatenation "; " of

(

((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

)

Can you try this for me pleeeeeaaaase, because also the model is important for us and not only the serialnumber

Thanks very much for your help :slight_smile:

Andi

If I try this as here: http://forum.bigfix.com/viewtopic.php?id=1552

item 0 of ((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

The result ist: Singular expression refers to nonexistent object.

I am a little bit confused???

(imported comment written by Lee Wei)

You can try this:

if (exists (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi)) of registry as string)) then ((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it) else “n/a”) & ", " & (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it) else “n/a”) & ", " & (hexadecimal integer (first 2 of following text of position 32 of it) /4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string) else “N/A”

(imported comment written by var91)

Hi,

yes thank works fine.

thanks Andi