Smart Group to find Duplicate Entries in JSS

mallenOR
New Contributor

I would like to create a Smart Group to find duplicate entries in the JSS. We don't always delete the computer out of inventory on the JSS when the person is termed.

16 REPLIES 16

mm2270
Legendary Contributor III

Actually there shouldn't be such a thing as duplicates if you're re-imaging the Macs when someone leaves. The Casper Suite uses the computer's MAC address (currently) to identify it, so if it gets re-imaged, the old computer record just gets replaced by the newly imaged Mac's record in the database.
Going forward, in Casper Suite 9, they'll be using the UUID of the Mac as its unique identifier but the process should be the same, since its still a hardware identifier.

If for some reason you really are certain you're seeing duplicates, it might be related to some other issue.

mallenOR
New Contributor

I just found a duplicate with the same MAC address and SN.

mm2270
Legendary Contributor III

Sounds like you may have another issue at work then. Do you happen to be using USB to Ethernet dongles with these when you image them or some other type of connector that could be causing some problems? You really should not see duplicates.
Also, what version of theJSS are you using? Not that it should matter. I'm nearly certain its worked this way for years now.

nkalister
Valued Contributor

generally this is caused by using removable network adapters during imaging without first registering the removable NIC on the JSS.
i'd bet dollars to donuts that the MAC address associated with each machine on the JSS is actually from a usb or thunderbolt ethernet adapter.

mallenOR
New Contributor

Yes, most of them are MacBooks that don't have a built-in Ethernet and someone forgets to enter the MAC address of the adapter into Removable MAC Addresses. So most of it is an issue with following a process. It would be helpful to have a Smart Group that will populate when it finds a duplicate entry in the JSS.

rrouleau
Contributor

Bringing this thread back to life... Would also like this feature added, or a way to do this.

lhscasper
Contributor

Hi rrouleau,

I have problems with students enrolling mutliple iPads all the time, so the way I find them is thus...
- so a search for all devices (and wait for the page to finish loading)
- export the list to CSV and open in MSExcel
- sort by the field that will contain the duplicate info (for me it's username)
- select the column that you just sorted
- on the home tab, click conditional formatting / highlight cell rules / duplicate values

works a treat although it is a bit fiddly

Cheers,
Chris.

P.S. A smart group with the ability to find duplicates, or a way to prevent people from enrolling multiple devices would be a nice feature.

jwojda
Valued Contributor II

was this ever addressed? we get quite a few duplicates as apple's quality seems to be slipping. We've had a TON of machines go into service and gotten system board replacements. These replacements seem to cause duplicate entries in the JSS.

mm2270
Legendary Contributor III

A system board replacement is going to create a duplicate entry because the JSS can't possibly know it was the same computer as before, since the hardware identifier changed. It can't use something like the computer name since that's so variable and very easy to have two or more systems named exactly the same. It can only go by a hardware identifier, and that's no longer the same, so, duplicate entry.
You may want to put a practice into place that if a Mac needs to go out for board replacement that you either purge the old existing record from the JSS before it comes back for re-enrollment, or see if there's a way to modify the existing entry to have the same hardware identifier as the replacement, again, prior to re-enrollment.

To answer your question though, I don't think there's been anything added to the Casper Suite to help with duplicate entries, but, speak to your JAMF account manager about MySQL commands that might help. I don't know specifically what it would be, but I'm fairly certain there is a way to gather duplicate systems in a sql query. That might help.

Edit: I had to double check, but its easy to edit the Mac record's UDID, Primary and Secondary MAC Addresses, so maybe make sure to get the new information ahead of time and edit all those fields, and then re-enroll it.

jwojda
Valued Contributor II

We're spread out, with lots of techs kind of running their own area, so I rarely find out about it unless I go prod them. I guess I will get in the habit of exporting to excel and searching for duplicates.

Chris_Hafner
Valued Contributor II

We have a hard policy here that says that any time a units logic board is swapped a tech will update the UDID in the JSS. All machine MAC addresses will be adjusted accordingly so you don't have to worry about those as they'll update the instant the unit checks in.

Also, we gave up on trying to track down removable adaptors and spent our time making sure it didn't matter to us. It's part of the reason we were early adopters of Casper 9

SeanA
Contributor III

In https://jamfnation.jamfsoftware.com/discussion.html?id=14125, @lisacherie uses a MySQL query on multiple serial numbers for a similar problem. It is not a JSS smart group or EA like some people want, but it is guidance on a workaround.

lisacherie
Contributor II

Wow old thread resurrection.

I also now do this with smart groups. Even with 9.82 I still see duplicates.

Using the API I pull in asset information from an external system to populate extension attribute fields. When there are duplicates the API fails to update both records, so I have been able to build a smart group of computers with blank entries for those extension attributes.

Unfortunately it seems to update the older record rather than the current record for the computer, so the smart group lets you see which serial numbers you can look up to delete the older record.

One of the defects is: D-009309 <- where only one entry is updated with the API. I don't have the defect id, for the issue causing there to be duplicates in the first place.

cam_mielbye
New Contributor

@lisacherie Wow thats a clever work around haha, I appreciate that and may try something similar. We've been getting a lot of duplicates from repairs especially with the 2018 macbook pros since board replacements change the UDID as mentioned above. Would be nice if Jamf had slightly more granular access to device attributes in the web UI.

rhooper
Contributor III

Thanks for the resurrection:
I have not seen any answers to this thread about how to parse for duplicate SN's. When the MLB is replaced, Apple updates the SN on the replacement board to match the one that it is replacing. BUT the UDID is different, which is a good thing as that could be compromised by an unscrupulous person. This creates two records Same SN, different UDID's.
So how do we create a smart group that locates the duplicate device records so we can view them and delete them as needed? Is there a method to do this?

ChrisJScott-wor
New Contributor III

The answer is that you can't and you won't (be able to) - this has already been raised with Jamf and they've decided it's outside of their scope.

But! It's not too tough to manage - here's how I do it:

  1. Export all computer records, including Serial Number, UDID, Last Check-In, Last Enrollment and Computer Name.
  2. Import the CSV into Google Sheets
  3. Sort by Serial Number and, secondarily, Last Enrollment
  4. Use this great conditional formatting trick to highlight all duplicate serial numbers in your sheet

This will highlight each duplicate system and give you a basic "history" of when the change happened. In all likelihood, this was due to a repair.

Then I just search Jamf for the UDID of the OLDER duplicate and delete it.