We are using Apple School Manager with a direct integration with JAMF. We have seen an issue where we have some duplicate students; all the information looks the same except that one will have a roster associated from ASM and one does not.
Is there a way to run a search query against this and just delete any user not associated with a roster?
The User-object side of Jamf was never finished IMO so this is not a feature we currently have. I suggest doing a blank search, Export the results, open in a spreadsheet. Cut the email column and paste into a decent text editor like BBEdit and pull a list of duplicates. Then comes the manual cleanup - you need to be sure the user with the roster is the one that the devices were assigned to. If not, you'll need to rename the user you want to delete (I put -old at the end), rename the good one to the proper username if it isn't (ours import from ASM with a -1 at the end), and then Edit the Device record to assign the correct username. Then the bad username can be deleted.
I figured out kind of a workaround for this. I did an advanced search and looked for "Roster Full Name" that is NOT LIKE " " (space). That searches for anyone who does not have a space in their roster full name. If there's a name in the roster full name field, it will have a space, so if there's no roster attached, there's no full name, thus no space. Very backwards, but it worked.
Since my last post, I have gone with a positive search, and then everything not in it, to find users that might need to be cleaned up, or verify that the user with the roster has the devices attached.
1) All users. 'Users with Roster Data', "Roster User Status" is "Active" OR "Inactive" OR "FailedPasswordLocked".
'Users without Roster Info', "User Group" NOT A MEMBER OF "Users with Roster Data"
2) Students. 'Students with Roster Grade info', "Roster Grade" MATCHES REGEX "\d".
'Students without Roster Info', "User Group" NOT A MEMBER OF "Students with Roster Grade info" AND "User Group" MEMBER OF "All Students"
You can create a Query that includes Computers and Mobile Devices, and the ones that don't have a device can probably be safely deleted.