<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Execute Script on Container]]></title><description><![CDATA[<p dir="auto">Hello,<br />
i like do run a script on a Container under "Infrastructure Services" and do something with all nodes in this Container. But how do i get the Container i right clicked on?</p>
<p dir="auto">For my testing i used this script:</p>
<p dir="auto">children = GetObjectChildren($1);<br />
foreach(p : children)<br />
{<br />
    trace(1, "Child object: name='" . p-&gt;name . "' id=" . p-&gt;id);<br />
}</p>
<p dir="auto">Even this does not work</p>
<p dir="auto">GetObjectChildren(FindObject(2)); =&gt; "Error 14 in line 2: Function or operation argument is not an object"</p>
<p dir="auto">Greetings</p>
]]></description><link>https://forum.netxms.org/topic/4068/execute-script-on-container</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:53:26 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4068.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Oct 2015 10:38:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Execute Script on Container on Fri, 30 Oct 2015 12:34:13 GMT]]></title><description><![CDATA[<p dir="auto">the key was the variable $object. Now this works as wanted!!!<br />
 </p>
<p dir="auto">children = GetObjectChildren($object);<br />
foreach(p : children)<br />
{<br />
    trace(1, "Child object: name='" . p-&gt;name . "' id=" . p-&gt;id);<br />
    interfaces = GetNodeInterfaces(p);<br />
    foreach(i : interfaces)<br />
    {<br />
        trace(1, "Interface: name='" . i-&gt;name . "' id=" . i-&gt;id);<br />
        SetInterfaceExpectedState(i, 2);<br />
    }<br />
}</p>
]]></description><link>https://forum.netxms.org/post/18153</link><guid isPermaLink="true">https://forum.netxms.org/post/18153</guid><dc:creator><![CDATA[LBKRE]]></dc:creator><pubDate>Fri, 30 Oct 2015 12:34:13 GMT</pubDate></item></channel></rss>