(imported topic written by SystemAdmin)
I’m trying to figure out how to modify hard coded DNS entries on a number of machines where the interface name is unknown, but I’m having a serious conflict between the output of my QNA tab and evaluation in my action tabs. I consistantly get the error “Relevance clauses must be surrounded by {and} guards.”
I’ve tried two approaches to this (one using Netsh and the other using regset) and can’t seem to get either action to work.
Here’s what I’ve tried:
NetSH code:
//Step1
waithidden netsh interface ip set dns {(names of connections whose (status of it = (connection status connected) AND name of it as string contains “Local”) of network)} static ###.###.###.### PRIMARY
//Step2 etc…
waithidden netsh interface ip add dns {(names of connections whose (status of it = (connection status connected) AND name of it as string contains “Local”) of network)} ###.###.###.### index=2
//This is capable of returning multiple answers, but usually returns just one.
Q: names of connections whose (status of it = (connection status connected) AND name of it as string contains “Local”) of network
Interestingly this fails with the same error as well: parameter “connectionname” = “{name of connection of network as string}” (fails both plural and singular)
RegSet code:
Parameter “ActiveNicGuid” = “{(guid of connection whose (status of it = (connection status connected)) of network as string)}”
regset “” “NameServer”="###.###.###.###,###.###.###.###"
//This can return multiple results, but again usually returns just one:
q: (guid of connection whose (status of it = (connection status connected)) of network as string
My understanding of Parameter rules suggest that a single returned value, however, ought to be turned into a singular string.
http://support.bigfix.com/fixlet/documents/WinActions_20081110.pdf
The rules of the parameter command are:
•Parameter expressions will be coerced into strings.
•Plural expressions that result in no values will result in an empty parameter value.
•Plural expressions that result in a single value that can be coerced into a string will assign the value.
•Plural expressions that result in more than one value will result in a failure of the action.
Any ideas? Is this a singular/plural issue? Is there some sort of “for each” type loop I can do in a big fix action to loop through each plural answer from relevance?
Thanks in advance for any thoughts.