Hello,
how can I make an automatic bind rule for a container that filters windows agents in which software inventory contains a specific program?
Thank you.
if (!$node->isAgent)
return false;
if ( $node->platformName ~= "windows")
{
table = AgentReadTable($node, "System.InstalledProducts");
if ( table == null ) return null;
colName = table->getColumnIndex("NAME");
for (currentRow = 0; currentRow < table->rowCount; currentRow++)
{
if ( table->get(currentRow, colName) ~= "Program name" ) return true;
}
}
return false;
Thank you! :)