/build/static/layout/Breadcrumb_cap_w.png

Automatically populate Manager for User, through LDAP

So using the lDAP import, you can bring users into KACE.  This import can be modified to pull almost any information from your AD to your KACE user table, by mapping it to the CUSTOM fields.

One thing I liked to map, was the Manager field.  But boy was it ugly when it came in, CN=MANAGER NAME, followed by a lot of jibber jabber of OU's.

I wanted JUST THE MANAGER name (and I could use that field has a reference to the manager as a user through USER.FULL_NAME !


For those that are not SQL wizards, and I am VERY much not a SQL wizard AT ALL, i thought it might be helpful to share with you a little ticket rule that runs 5 minutes after the morning LDAP import.

 
 update `USER`
Set `CUSTOM_3` =
 IF(
        LOCATE('CN=', `CUSTOM_3`)  > 0,
        SUBSTRING(`CUSTOM_3`, 4, LOCATE(',', `CUSTOM_3`) - 4),
        `CUSTOM_3`
    )

This little guy runs, and cleans up the whole mess and leaves me with just a manager name.

 

NOTE:  I mapped my manager name to CUSTOM_3, and you may need to adjust accordingly.


Double NOTE:  If someone found a much easier way to do this, or fancier, let me know, as I always enjoy a good slap against the face at missing the obvious!

 

ENJOY!


Comments

  • This is exactly what I was looking for! I'm curious though, what do you put in the Select field for the ticket rule?

    I'm guessing you're using a ticket rule inside your queue, right?

    Here's a screenshot of my setup, I just changed custom_3 to custom_4. https://www.dropbox.com/s/6p5ui6a6k6umaq2/Screenshot%202014-06-20%2009.04.54.png - michaellynton 9 years ago
    • What I posted above (the update) is within the select field. When it comes to the SELECT field in ticket rules, it runs the query within that box when the frequency criteria is met. It doesn't necessarily HAVE to be a select statement.

      I just have this in my main queue, with a schedule to run every morning 5 minutes after my daily LDAP import.

      Just remember: Depending on your LDAP import schedule, i know mine resets the manager field to the long-form so I have the ticket rule to do the update run after the ldap import is complete in the wee hours, leaving a 5 minute gap where the manager field would not look 'right' if anyone saw it. - Wildwolfay 9 years ago
      • Perfect! Thanks for clarifying. Didn't know this could go in the SELECT field. It works great - thanks for sharing! - michaellynton 9 years ago
This post is locked
 
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