snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Import Location info for LDAP Synced User

Open slinkoff opened this issue 9 years ago • 12 comments

Expected Behavior (or desired behavior if a feature request)

When I import user info from a CSV, if that user already exists as an LDAP user, the import will still replace or add missing fields to the user. E.g., none of my LDAP users have a Location set. I want to add their locations by using the import from CSV function and setting it that way.


Actual Behavior

The import completes successfully but the Location data isn't added. I'm guessing because it's an "Imported from LDAP" user.

If this doesn't work, is there a way to revert user accounts from being LDAP synced back to CSV imported/manually created users? That way I can import the Location info and then resync from LDAP to make them LDAP users again but with their Location info populated.

I can't just delete the users and reimport because I would have to check in all their assets.


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running v3.6.3 build 15 (g1bf34d7)
  • What OS and web server you're running Snipe-IT on Windows 2012 R2 on WAMP
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) WAMP install guide
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error n/a
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error user CSV import
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproduceable on the demo.
  • Include any additional information you can find in app/storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

slinkoff avatar Aug 30 '17 16:08 slinkoff

This all came about because of this bug: https://github.com/snipe/snipe-it/issues/3134

I had my users all manually imported via CSV with their Location information filled in. Then manually synced with LDAP and they became "Imported via LDAP" users with Location info intact. We were happily checking assets in and out and syncing via LDAP without losing Location info.

Then I decided to setup a scheduled task to do the LDAP sync automatically so we didn't have to manually trigger it from within Snipe-IT. After the first sync using the command line all the Location info got removed from the users because I'd left that entry blank in the command line thinking it wouldn't overwrite (as per the bug). I've made the PHP file change now so no longer losing the Location field after manually entering it on a user but I want to get the Location details back for the thousand or so users in Snipe-IT. CSV re-import seemed the logical way but despite completing successfully it doesn't populate the Location field on the users. How can I do this without losing all the assignment info we now have?

slinkoff avatar Aug 30 '17 16:08 slinkoff

I don't believe it's skipping their information because they were imported from LDAP, but is it possible that you (or someone) synced over the uploaded CSV info? Also, which CSV upload are you using? The one for users? If so, it needs a location ID, not a location name, per the documentation on the User Import upload page.

snipe avatar Sep 07 '17 01:09 snipe

I know the CSV I am using works because it is the same CSV I used to import the user info originally, including their location info (yes I it contains the location ID, not a name). This is how I know the import is not amending the LDAP users' info.

I also import the CSV and immediately check some users to see if their Location field has been re-added and it hasn't. There is no LDAP sync going between me importing the CSV and me checking results and even if there was, that LDAP sync would no longer be overwriting the Location field now that I have made the fix from #3134

To summarise the problem again for clarity it is:

  • Import new user from CSV - works
  • LDAP sync converts new user matched with user in AD to type "LDAP imported user" - works
  • Import same user info from CSV again (e.g., to re-add or update location field) - appears to work (success message)
  • User info not actually updated now that it has become an LDAP synced user. - fail

slinkoff avatar Sep 07 '17 07:09 slinkoff

Are you using a location ID or location name in the location field in the CSV?

snipe avatar Sep 07 '17 08:09 snipe

As I mentioned previously, I am using the ID and the CSV also succesfully imports the Location prior to the user becoming an LDAP synced user account. The CSV is not the issue.

slinkoff avatar Sep 07 '17 10:09 slinkoff

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jan 20 '18 05:01 stale[bot]

Also seeing this issue still on Version v4.4.1 - build 3636.

hoolius avatar Jul 17 '18 18:07 hoolius

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Sep 15 '18 18:09 stale[bot]

Low priority, but still relevant. Right now we manually bulk edit in the DB itself.

hoolius avatar Sep 17 '18 12:09 hoolius

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Sep 17 '18 12:09 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Nov 16 '18 19:11 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

stale[bot] avatar Nov 23 '18 19:11 stale[bot]