I am not in a position to test this properly. So, please use at your discretion and test it thoroughly before looping through all of the serials. But, this should work... Create a txt file with one serial number per line. Press return or type something one line below the last serial number (the script will omit the last line of the txt file).
I use something similar to image, configure and then delete machines that are not going to be managed.
Best,
-Chris
#!/bin/sh
NUMBERS="/path/to/file.txt"
/bin/cat $NUMBERS | while read SERIAL; do
/usr/bin/curl -X DELETE -u username:password https://your.jss.server:8443/JSSResource/mobiledevices/serialnumber/$SERIAL 2>/dev/null
done
exit 0
If there are any criteria (Model perhaps?) that you could use to build a device group, you could then delete the entire group of devices at once.
@techhelprhs I finally had a chance to try this out with some devices we resold, and it worked beautifully! Thank you so much!