KACE 1000 smart machine lables based on logged in user label
Is there a way to create a smart machine label populated by the logged in user's label assignment? I am unable to deploy a script based on a user labels.
Community Chosen Answer
Try this for your Smart label query - I tested with some user labels and it worked fine here (i.e. the machine Smart label was applied to the corresponding machines). In the next to the last line, include whatever labels you want to target (and create a corresponding Smart label to accompany it).
So, for example, if I wanted to target a user label named "managers" (and create a corresponding Smart label named "managers"), I would use this:
WHERE LABEL.NAME rlike 'managers'
If I wanted to create another that targeted multiple user groups (hr and payroll, for example), I would use this for that line:
WHERE LABEL.NAME rlike 'hr|payroll'
Here's the Smart label query itself, which you can run as a report (or MySQL Query Browser) to give you an idea of which machines it will target (and corresponding users and user labels):
SELECT MACHINE.NAME, MACHINE.USER, LABEL.NAME
JOIN USER ON (USER.USER_NAME = MACHINE.USER)
JOIN USER_LABEL_JT ON (USER_LABEL_JT.USER_ID = USER.ID)
JOIN LABEL ON (LABEL.ID = USER_LABEL_JT.LABEL_ID)
WHERE LABEL.NAME rlike 'user label 1|user label 2|etc'
ORDER BY LABEL.NAME, MACHINE.NAME
If you need help with Smart labels, I wrote an article with a few tips/tricks:
Hope that helps!