I am trying to author a fixlet that looks for Windows PCs with static IP addresses that use a certain DNS server. The reason for this is our DNS servers are going to change soon and I would like to deploy a fixlet that changes the server on those PCs. I created an analysis that looks for those PCs and it comes up with what I think are the correct amounts. When I try to take the relevance I used in the analysis and place it into a fixlet, the relevance fails to find any applicable computers. The only difference between the analysis and the fixlet is the lack of a “properties” field in the fixlet authoring task. It is there, in the analysis, that I placed the relevance which looks for and finds the computers using the DNS server which needs to be changed. In the fixlet, I just placed that relevance with the other conditions, in a sequence. Here’s the relevance:
Relevance 1: windows
of
operating system
Relevance 2:
not
exists
adapter
whose
(address
of
it
!=
“0.0.0.0”
AND
dhcp enabled
of
it
)
of
network
Relevance 3:
(exists keys “HKLM\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces” whose (exists values whose(name of it = “192.168.1.2” AND it as string as lowercase = “192.168.1.2” as lowercase ) of it) of registry)
Each piece of the relevance makes it through the fixlet debugger and evaluates to the correct conditions. Where am I going wrong?
Can you create an analysis with just the first and second relevance statements and see what the computer count is. Then also do that with the first and third and see what comes back. That might give you some insight on whehter something is wrong with the second or third statements.
The problem is definitely relevance 3. I imagine it is “correctly” reporting False when tested in relevance debugger on your system, but it would likely return false on every system. You’re trying to inspect the registry values of the different interface registry keys underneath the key “HKLM\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces”, e.g.
values of keys of key "HKLM\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces" of registry
But your relevance is missing a level,
values of keys "HKLM\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces" of registry
There aren’t any registry values at that level, only keys, so it will always be false. You’re also checking for a registry string value in that key that has both the name and value of “192.168.1.2” in your whose clause. I don’t have a static IP setup to test, but that would be the following entry in the registry:
Is that what is intended?
If so, try the following:
(exists values whose (name of it = "192.168.1.2" AND it as string = "192.168.1.2") of keys of keys "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces" of registry)