Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #JAMF: Puts a computer in a group based on serial.
- # ——————————— API Info ———————————
- apiuser="user"
- apipass='password'
- jamfProURL="https://jamf.server.com"
- GroupID="1024"
- # ——————————— Getting the serial ———————————
- computerserial="$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print $NF}')"
- # ——————————— Things that gets done ———————————
- curl -k "$jamfProURL/JSSResource/computergroups/id/$GroupID" --user "$apiuser:$apipass" -H "Content-Type: application/xml" -X PUT -d "<computer_group><computer_additions><computer><serial_number>$computerserial</serial_number></computer></computer_additions></computer_group>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement