-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to run snipeit:ldap-sync and specify a custom OU #3993
Comments
If LDAP sync is enabled in the configuration, there should be a "Location OU" field that you can specify for each location. When you do an LDAP sync, either through the UI or via |
If I go to the People menu, and then click the "LDAP Sync" button there, I can specify a location (but I see no "Location OU" field). That will just sync ALL of my users and set their location to the one location I select. I want users to be put into a location based on the OU that they are in in LDAP. If there is supposed to be a location OU option in the LDAP configuration, that doesn't appear to be there. |
Yep, I meant in the Location edit screen. So if you actually edit a location, you’ll be able to specify an OU that corresponds to that location. If you have a look in LdapSync.php you’ll see something like:
This will grab each location that has an OU set, and override every user within that OU with said location. |
Brilliant, thanks! I completely missed that option on the Locations page. I didn't realize LDAP was becoming more integrated into various parts of Snipe-IT. It worked, but it did miss a few special cases. I have my New York users under something like Do you think this is something I should open a new issue on? It's just a minor annoyance for me, nothing major. Briefly looking at the code, it looks like it should handle this just fine, but it doesn't. |
@app-reroute As for raising a new issue, I would, just for the sake of being able to track the change that's needed. I will have a look at my workplace's installation, as we do have a similar hierarchy to what you describe, and I'm fairly sure everyone in the sub-OUs is syncing across fine. Could it be a permissions issue on that |
@richardhofman6 |
@richardhofman6 v4 was released on friday btw :) |
@snipe Thanks! I saw that just after I posted my previous comment. I updated our install and everyone’s liking it so far! @app-reroute I’m just about to run a manual sync with a test OU and will get back to you. |
Aha! I think I've figured this one out @app-reroute. The process for sorting users into OU-based locations goes like:
The problem I can see, is that in step 3, the locations aren't processed in any particular order, so suppose you have an OU structure with location mappings like:
If a user is in Unfortunately, restricting the depth of the search (i.e. "only pick users with I'll look into this and update. |
Pretty sure #4181 fixes the issue you're seeing. It definitely synced the sub-OU locations in my directory perfectly after this change (and previously I did have a demonstrable case where it wasn't syncing properly). Also confirmed (via some debug code that I've left out in the PR) that the sorting method I'm using works. |
Does LDAP sync for locations only work if the users are in separate OUs? Currently our OUs are separated by contactors, interns, and staff, but may be in different locations (remote and/or 3 different offices). We don't separate OUs by location, just by type. |
How would I get this to work. I have a parent ou of Employees, and then child OU's of locations. If one one location i do OU=location A,OU=Employees,DC=domain,DC=com it sets everyone under the parent OU and the Child OU to that location. |
Or how can I pull the location of each user from the location set in AD in the users attributes? |
I would like to automatically import our users along with their locations periodically via cron. Our users are currently in multiple OUs, separated by office location. I might be missing something obvious, but I'm not seeing a way to do this currently (in v4b6).
What do you think about an interface like this:
I'd be happy to write the PR. Off-hand it looks like modifying
Ldap::findLdapUsers()
to accept an optional $ou argument, and then modifyingLdapSync.php
to use the optional argument if it is given during the call toLdap::findLdapUsers()
.The text was updated successfully, but these errors were encountered: