bind filter

Started by wuwei, January 21, 2021, 03:02:00 PM

Previous topic - Next topic

wuwei

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.

Egert143

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;

wuwei