Posted on 06-05-2019 03:39 PM
I have over 400 devices I am trying to remove from my JSS using the JAMF API and it doesn't seem to be doing anything. Would greatly appreciate any thoughts. See the script below:
#!/bin/sh
NUMBERS="path/to/file.txt"
/bin/cat $NUMBERS | while read SERIAL; do
/usr/bin/curl -X DELETE -u *username*:*password* https://jssurl:8443/JSSResource/mobiledevices/serialnumber/$SERIAL 2>/dev/null
done
exit 0
Posted on 06-12-2019 10:11 AM
This is what I do to have our macOS devices delete themselves. I figured that I'd throw this out here in case the curl command arguments or syntax helps. Of course, I am not pulling from a list of serial numbers.
CAM=`networksetup -getmacaddress en1 | cut -c19-35 |sed 's/:/./g'`
curl -k -v -u *username*:*password* https://jssurl:8443/JSSResource/computers/macaddress/$CAM -X DELETE
JAM=`networksetup -getmacaddress en0 | cut -c19-35 |sed 's/:/./g'`
curl -k -v -u *username*:*password* https://jssurl:8443/JSSResource/computers/macaddress/$JAM -X DELETE