Checking for active/passive node of cluster

(imported comment written by thesurg3on91)

I changed mine up a bit to say if it is a cluster or not, but if i could get a comma delimited list so that I can get around the “” in the bigfix results pane… it would be great.

if (exists service “clussvc”) then (item 0 of item 0 of it, item 1 of item 0 of it, item 1 of item 1 of it) of (((substring between “%22” of item 0 of it, substring between “%22” of item 1 of it) of (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”),((string value of property “Name” of it, ((if (it="-1") then “StateUnknown” else if (it=“0”) then “Up” else if (it=“1”) then “Down” else if (it=“2”) then “Paused” else if (it=“3”) then “Joining” else “relevance unknown”) of (string value of property “State” of it))) of select objects “Name, State from MSCluster_Node” of wmi “root\MSCluster”)) whose (item 1 of item 0 of it = item 0 of item 1 of it) as string else “”

2 Likes

(imported comment written by BenKus)

You can add this to the front of your expression:

concatenation ", " of ()

Ben