We have several iPAds we use to loan to students when they forget or lose their device. What I am trying to do is have them always be named loaner-1, loaner-2, etc. When we receive one back from a student we do wipe it so it is ready for the next student. How can I force it to keep its name even after wiping it and setting it up again with a new student?
If you go to Settings > Global Management > Re-enrollment, there is a setting for "Clear user and location information on mobile device and computers". So when re-enrollment happens, the user information will stay the same.
I'm not sure if you can keep the actual device name like that. You can try using the API, just run the API job once a day or something so that it will update the device name. I'm not sure if this works or not so please test before running.
Fill out the apiUser and apiPass with your JAMF Pro username, jssurl with your jss url. You only need to put jss.company.com:8443.
The part you will need to customize is the "loaner-1" section and "123" section. The loaner-1 should be the device name you want to set as, 123 is the device ID, for the particular device. This should be the Jamf Pro Mobile Device ID when you click into the device in Jamf Pro.
#!/bin/sh # Define Variables ### JAMF Pro username / password apiUser=' ' apiPass=' ' ### JAMF Pro URL jssurl=" " ### Device Name curl -ksu "$apiUser:$apiPass" -X POST "https://$jssurl/JSSResource/mobiledevicecommands/command/DeviceName/loaner-1/id/123" -H "accept:application/xml"
It is what I have been using for quite some time. The only downside is that all the serial numbers you have assigned to the prestage will use that setting, so if they are new devices then they will get something like 'iPad' as the default name. For this reason once devices have gone thru the setup process I either modify the prestage or create a new prestage and move those devices into it.
@joshuasee We're doing different prestage enrollments as a means to group iPads when needed to assign apps and configuration profiles to them. It requires creating a smart group for each one to handle the assignments but it seemed like the best way to reliably and easily(relatively speaking that is) maintain assignments of apps and configurations in the event that iPads are erased. The other method was to assign by name hence the reason for being curious about this thread as assigning by name is not a good solution if the device doesn't keep its name upon being erased.
I've considered using MUT or scripting with the api the name of what the device should be but I don't think that works if we have a configuration profile that prevents the user from renaming.
@joshuasee We don't have one prestage per device, that would be virtually unmanageable. But we do group devices into prestages based on how they are configured (staff/student, shared/non-shared, etc.). We tend to get almost all our devices in the summer at which time I create new prestages to handle those devices and will use "List of Names" to assign the names if they are not being named by serial number. Once they have gone thru the first setup and have an inventory record in Jamf, I modify the prestage to use Default Names. This past year we modified our naming to use serial number which has been much easier to manage, but we do still have some that we assign more meaningful names. We have about 6000 devices and about 2 dozen prestages.
In order to assign a name based on serial number you could use the Inventory Preload option in Global Management Settings. If that feature had existed when we started off I would have used that, but for us with devices already named in inventory using Default Names in the prestage works for us.
"Default Names—Depending on the enrollment status of the device, the following can happen when this option selected:
If the device is being re-enrolled with Jamf Pro, the value of the Mobile Device Name attribute field in the device's inventory information in Jamf Pro is assigned to the device at enrollment.
If the device is being enrolled for the first time with Jamf Pro, the current name of the device persists after enrollment."
@cdenesha Thanks for the link. I certainly wasn't aware it worked that way and when we originally started managing iPads with Jamf would have never thought to try that. We used the other methods to name the iPads and apparently they don't work that way. It's looking like I have some changes to explore. Thanks.