/build/static/layout/Breadcrumb_cap_w.png

Can I create a smart label that checks on user login based on a label of user names

Can I create a device smart label that would check for computer devices based on User Name for the computer which is defined in a user label?  Right now, to achieve this, I am setting my device smart label to do a REGEX search against a static set of usernames which I use the ^(user1|user2|....)$ expression to define.


Is it possible to have it look against a label of user names instead.  Or if not, can we plan on having this as a new feature?


0 Comments   [ + ] Show comments

Answers (2)

Posted by: chucksteel 4 years ago
Red Belt
0

Yes, this should be possible. Are you sure you want to use logged in user? I ask because this may change, particularly if the computer updates inventory when at the login window.


Comments:
  • Hi, yes, I am currently using User Name, but for people's personal computers which I am mainly targeting the logged on user should be the same as what Kace thinks or knows as the owner of the computer.

    How would I have the define the Advanced Search to enable the device search against a label of user names? - tuyen 4 years ago
  • As Chuck pointed out, User smart labels are evaluated at login. Device smart labels are evaluated at the inventory check-in interval.

    If you have a smart label that depends on another smart label you will want to set the order in which they are evaluated.

    To set order in which to run the Smart Labels:
    On the left navigation bar, in the Home section, click Label Management.
    On the Label Management panel, click Smart Labels.
    Select Choose Action > Order Labels > Device Smart Labels. - KevinG 4 years ago
    • I have a static label of user names which I defined in Settings -> Users

      In Devices, I want to define a smart label that would look at User Name and search based on list of users in the static label of users. Is that possible?

      Right now I am having it do a REGEX filter against a static search expression that I define. Can I have it check against a label of users? And how would I be able to do that? - tuyen 4 years ago
Posted by: chucksteel 4 years ago
Red Belt
0
  1. In Inventory create a new smart label
    Open the smart label tab and enter a label name and click Save. We will be changing the SQL so there's no need to set any criteria
  2. Open the newly created smart label
    Home, Label Management, Smart Labels, click on the label
  3. Click the Edit SQL button
  4. Delete everything in the SQL text box
  5. Paste in the query below
    Be sure to put your label name where it says "your label name"
  6. Save the label


SELECT MACHINE.NAME AS SYSTEM_NAME, SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE.ID as TOPIC_ID FROM MACHINE  
LEFT JOIN USER  on USER.USER_NAME = MACHINE.USER
LEFT JOIN USER_LABEL_JT on USER_LABEL_JT.USER_ID = USER.ID
LEFT JOIN LABEL on LABEL.ID = USER_LABEL_JT.LABEL_ID
WHERE LABEL.NAME = "your label name"

Again, if the inventory updates on a machine when there isn't a logged in user, the label will not be applied. If you are assigning owner to machines, then I would use that criteria instead. In that case, the following query should be used:

SELECT MACHINE.NAME AS SYSTEM_NAME, SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE.ID as TOPIC_ID FROM MACHINE  
JOIN ASSET on ASSET.MAPPED_ID = MACHINE.ID
JOIN USER OWNER on OWNER.ID = ASSET.OWNER_ID
LEFT JOIN USER_LABEL_JT on USER_LABEL_JT.USER_ID = OWNER.ID
LEFT JOIN LABEL on LABEL.ID = USER_LABEL_JT.LABEL_ID
WHERE LABEL.NAME = "your label here"


Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ