Trying to mass add groups that will have custom queries to populate the members of that group, I am testing this with one group, the name of the group will be BK00112 and I want to create a dynamic query that will pull all node names that being with BK00112 (there are two currently), but I cannot get the filter syntax correct to do this, it keeps pulling all nodes instead of filtering.
See code:
$members = @(
@{ Name = "Store Devices"; Definition = "filter:/Orion.Nodes[Caption StartsWith ‘bk00112’]" }
)
$groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(
# group name
“bk00112”,
# owner, must be 'Core'
"Core",
# refresh frequency
60,
# Status rollup mode:
# 0 = Mixed status shows warning
# 1 = Show worst status
# 2 = Show best status
0,
# group description
"Store Group",
# polling enabled/disabled = true/false (in lowercase)
"true",
# group members
([xml]@(
"<ArrayOfMemberDefinitionInfo xmlns='">schemas.solarwinds.com/.../Orion'>",
[string]($members |% {
"<MemberDefinitionInfo><Name>$($_.Name)</Name><Definition>$($_.Definition)</Definition></MemberDefinitionInfo>"
}
),
"</ArrayOfMemberDefinitionInfo>"
)).DocumentElement
)).InnerText
Why is this not working as expected, it creates that group correct but the group member filter is not pull only those nodes that StartWith bk00112, why?
Thanks in advance for any help someone may be able to provide here.