Skip to main content
Question

JSS Not Saving New Mobile Device Name

  • April 9, 2016
  • 7 replies
  • 47 views

Forum|alt.badge.img+7

Hello All,
I don't know if I have found a bug or if I'm missing a step.
I can enforce a mobile device name from JSS and if the user renames the device the name is reset by JSS to its correct value as expected. Manually enforcing device names works correctly.

If I use the API to rename the same device the JSS shows the new name has been uploaded correctly and both the mobile device name changes and name of the device shown in the title. Everything looks as it seems it should. If I click on the "Edit General" button the device name shows as the correct (new) value.

I am also updating the user information at the same upload and this is working as expected, so my upload/script is working correctly

The problem is that unless I click on the "Edit General" button and then click "Save" the device name reverts to its previous value on the next inventory.

In other words it seems like the new name is being uploaded correctly to the JSS but the JSS is not saving the name changes and reverting to the previous value. The other values I am uploading at the same time save as expected but he previous name remains enforced as if I had not tried to make any changes to it.

Below is the xml I am uploading.

Am I missing a step required for JSS to save the new (enforced) device name and not revert to the previous one?

Regards
Graeme

<mobile_device> <general> <display_name>iPad177 (School name)</display_name><device_name>iPad177 (School name)</device_name><name>iPad177 (School name)</name> </general>

<location>
<username>BSS</username><real_name>School Name</real_name><email_address>school email address</email_address> <position/> <phone/> <department/> <building/> <room></room> </location>
</mobile_device>

7 replies

Forum|alt.badge.img+7
  • Author
  • Contributor
  • April 17, 2016

Just a follow up for those wanting to do the same thing, JAMF support has provided me with a sample script that uses the command method rather than the xml method. By modifying my script to use the following sub I have it working.

Hope this is useful for someone else.
Regards
Graeme

top_level_url = "https://my.JSS.com:8443/JSSResource"

def sendRenameCommandtoJSS(id, New_Name):

'# We are enforcing the name JAMF say send a command because it is friendlier for cloud customers
'#"id" the the device ID returned by a query or complete dump of devices from the JSS API Devicename = New_Name.replace(" ", "")
'# Errors out with not supported version error if there are any spaces in Devicename command = top_level_url "/mobiledevicecommands/command/DeviceName/" Devicename "/id/" str(id)
req = urllib.request.Request(command)

req.get_method = lambda: 'POST' #request = urllib.request.Request(resource) try: opener.open(req) except urllib.error.HTTPError as e: print(str(e), command)

Edit, I have tried multiple times go get the code in a easily readable format, have not been successful. Should still be understandable though.


Forum|alt.badge.img
  • New Contributor
  • October 18, 2016

Hi,

I am also experiencing the same problem and it is frustrating!
A solution please?


Forum|alt.badge.img
  • New Contributor
  • November 10, 2016

I have the same issue.
I checked that the Enforce Mobile Device Name Checkbox is selected under the general tab. And device_name_type is set to 1 in the database table devices. I use curl to update the record then verify the entry in jamf. If i update inventory and send blank push the name in jamf changes back to whatever it is on the ipad.


Forum|alt.badge.img+3
  • New Contributor
  • January 6, 2017

I am also having the same issue. Any updates on this?


Forum|alt.badge.img+3
  • New Contributor
  • January 6, 2017

+1

Everything was working great week ago and now even my new pre-staged iPads will NOT be updated to the pre-stage enrollment settings with formatting the device name for the ipad. It used to format our name for us automatically on pre-stage but now they just come up ipad and I cannot change the name without excluding it from scope (that blocked editing by students) and changing it then taking it out of exclusions.

Kind of a pain... nothing but problems, work arounds, commands ending up in la-la land etc...

Tried everything unchecking "allow device name changing" both in restrictions in scope and pre-stage... we cannot have the students put putting their creative names on these devices again.

Don't understand what is going on nothing was changed on our end as it was working as expected last week in jamf remotely changing names of devices and new devices were named automatically properly.

New update bugs? I know jamf was recently updated... fix one bug create ten? Not sure just spent all day trying to find a workflow solution to this crappy way of updating device names that has been happening today.

Thanks.


Forum|alt.badge.img+1
  • New Contributor
  • February 23, 2017

Same issue here. PUT correct names to API. "Enforce Name" is checked. At inventory name reverts. API does me no good if this isn't working.


Forum|alt.badge.img+7
  • Contributor
  • April 25, 2017

We had the same issue. We had a restriction blocking the device name from changing. We changed the setting to allow name change and the iPads are now getting the new name.