Posted on 12-23-2014 12:06 AM
Hi all
Does anyone know of a way to clear out the contents of the User & Location fields for Mobile Devices using the API? Writing a new username into those fields using the API appears to perform an LDAP lookup, but it only updates the rest of the fields (email, department, position, etc) if they are empty. I'd like to empty out the fields then run a script to repopulate the user information.
Also, it seems that updating the User & Location information on one device will change that users details on all other devices with the same username. Is this expected behaviour?
Patrick
Posted on 12-23-2014 02:29 AM
I haven't tried it that way round but I would assume you could just upload the xml file with no data between the tags, e.g:
<computer>
<location>
<username></username>
<real_name></real_name>
<email_address></email_address>
<position></position>
<phone></phone>
<department></department>
<building></building>
<room><room/>
</location>
</computer>
Posted on 12-23-2014 06:22 AM
In my experience, to clear a value, you mustn't send "<value/>", but you have to omit that tag completely in the PUT request. Might be a bug, might be a feature, YMMV, and so on :-)
Posted on 12-23-2014 12:26 PM
Does anyone know of a way to clear out the contents of the User & Location fields for Mobile Devices using the API?
I have always sent the following and it clears out the information of a user and location information:
<computer>
<location>
<username/>
</location>
</computer>
As for
Also, it seems that updating the User & Location information on one device will change that users details on all other devices with the same username. Is this expected behaviour?
Yes, that is expected behavior and makes sense as well. The user information is looked up based on username, which then goes to userID. The userID stores all the information for a user. If you update it in one place, it only makes sense that it updates everywhere else. Otherwise you would have a separate user for each device but with all the same usernames, which could get really confusing and not very well designed from a database side of things
Posted on 12-23-2014 05:55 PM
Thanks for the replies everyone. We've got it working, it looks like you need to remove the Username before you can blank out the other fields. Processing each record twice solves the problem.
Posted on 01-26-2017 02:23 PM
Sorry, API n00b here. How are you writing / scripting this command to clear the User & Location data for a particular JSS record? @plawrence @brandonusher @davidacland