Relevance issue

Maybe I am just tired or I have been working too much. Myself and another employee (@Ftoole) do not understand what the issue is. It should resolve to false. Can someone help me make sense of this or point out what I am doing wrong?

It may be easier to read like this…

   q: if not exists value whose (name of it is "ApplyDefaultDomainPolicy") of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of (x64 registries) then True Else if exists (value "ApplyDefaultDomainPolicy" of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of (x64 registries) !=0) Then True Else False
A: True
T: 1.980 ms

q: value "ApplyDefaultDomainPolicy" of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of native registry !=0
A: False
T: 1.132 ms

q: not exists value whose (name of it is "ApplyDefaultDomainPolicy") of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of native registry
A: False
T: 0.944 ms

q: Value "ApplyDefaultDomainPolicy" of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of native registry
A: 0
T: 0.188 ms

In the first relevance, where you compare the value to 0, that returns “False”, so you’re actually checking whether False exists; and False does exist.

Q: exists False

Should give a True.

I’ll type more when I get back to a computer

I think I understand. Let me work on it

Yeah I think you can remove the whole if/then/else and just have either

Not exists values "thing" whose (it = 0) of keys "path" of x64 registries

Or

Not exists values "thing" whose (it != 0) of keys "path" of x64 registries

Depending on which condition you actually want.

This seems to work.

q: if not exists value whose (name of it is "ApplyDefaultDomainPolicy") of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of native registry then True Else if (value whose (name of it is "ApplyDefaultDomainPolicy") of key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" of native registry !=0) Then True Else False

1 Like

In the screenshot you can see the registry at the top and the value is Zero. The relevance should be resolving to false because the key exists and it is set to zero. However, it was resolving to true.

We want the fixlet to be applicable to systems that don’t have the key or have the key and it is not set to zero.

Seems simple and I am sure I have done this 100 times but my brain has been fried lately. :slight_smile:

My normal formulation for this is one of:

not exists key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" whose (exists value "ApplyDefaultDomainPolicy" whose (it as string as integer = 0) of it) of native registry

or

exists key "HKEY_LOCAL_MACHINE\System\currentcontrolset\services\kdc" whose (not exists value "ApplyDefaultDomainPolicy" whose (it as string as integer = 0) of it) of native registry

The first will be true if the value does not exist or its value != 0, independent of the key’s existence
The second will be true if the key exists, but the value is not present or is present but != 0

1 Like