Issue running WMIC with the LIKE operator in a custom inventory rule?
Attempting to use a custom inventory rule to return mappings to network printers (printers that print to an IP port). WMIC command as-written works on XP and returns the expected results:
WMIC PRINTER WHERE "PortName LIKE 'IP_%'" GET Name,DriverName,PortName /format:value
The custom inventory rule in KACE appears as:
ShellCommandTextReturn(WMIC PRINTER WHERE "PortName LIKE 'IP_%'" GET Name,DriverName,PortName /format:value)
However, the rule fails because KACE is dropping the quotations (") in the arguments list according to kdeploy.log. This results in a syntax error for WMIC (invalid alias verb).
[Sat Jan 19 13:16:48 2013] KLaunch Execute command=[WMIC] args=[PRINTER WHERE PortName LIKE 'IP_%' GET Name,DriverName,PortName /format:value]
[Sat Jan 19 13:16:48 2013] LIKE
[Sat Jan 19 13:16:48 2013] - Invalid alias verb.
Has anyone seen this before? I thought about passing an invalid expression (e.g., double quotes) hoping at least one set of quotes would be preserved.