I am looking for syntax help on how to PUT the <username> within ../JSSResource/computers/id/$ID/subset/location using curl. Any ideas?
I should also state that I must use BASH to accomplish this task.
I am looking for syntax help on how to PUT the <username> within ../JSSResource/computers/id/$ID/subset/location using curl. Any ideas?
I should also state that I must use BASH to accomplish this task.
Best answer by freddiecox
Do you have a list of users that you need to assign to a computer or is this something you will need to do occasionally?
A very basic way:
echo "<computer><location><username>$userID</username></location></computer>" > ~/yourxmlfile.xml
curl -k -v -u CasperAPIUser:CasperAPIPassword $JSSURL -T ~/yourxmlfile.xml -X PUT
Notice the $userID variable and $JSSURL variable. I am assuming you would know the correct URL to be able to successfully post this.
Edit: I haven't tested this specific code as I was condensing an old script that I had, but it should work as you are wanting.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.