/build/static/layout/Breadcrumb_cap_w.png

Systems Management Question


Device Smart Label based on User LDAP Group?

07/09/2019 233 views

Hello,

I would like to create a smart label of all devices that are assigned to members of an Active Directory user group. Is there a way to create this type of smart label using the label wizard and/or SQL?

I've tried playing around with the wizard, but don't see any way to associate user labels into a device label.

0 Comments   [ + ] Show comments

Comments



Community Chosen Answer

2

I have something that might work for you.

First, make a User LDAP label that looks for members of the AD group in question.  See the example below if you need help getting started with that part.

When the User Import runs, the users in that AD group will get this label in KACE.


Next, create a SQL Device Smart Label to look for the LDAP label of the user who uses the Device:

select
    M.NAME,
    U.FULL_NAME,
    GROUP_CONCAT(L.NAME SEPARATOR ', ') AS LABEL,
    BIOS_SERIAL_NUMBER
from USER U
join MACHINE M on U.FULL_NAME = M.USER_FULLNAME
join USER_LABEL_JT UJT on U.ID = UJT.USER_ID
join LABEL L on UJT.LABEL_ID = L.ID
group by U.FULL_NAME
HAVING GROUP_CONCAT(L.NAME) LIKE '%User - LDAP label created in step 1%'

This will only return one device per user, so you may need to modify as necessary.  Also works as a handy report.

Hopefully this helps!

Answered 07/15/2019 by: ondrar
Black Belt

All Answers

0

Hi LosNats456,

in default we can't dynamically group devices on user ad attributes. What you can do is running a script which echos all of the usergroups to a textfile and doing an inventory afterwards. Over a custom inventory you can then put the device in a label. Would that work for you?

Kind Regards

Timo

Answered 07/11/2019 by: Timokirch
Black Belt