Hello Guys,
i'm writing a script to allow ,our l1 support, unenroll a Mac. this script will do more than a remove framework. But I think everything go too fast. let me explain you: first thing, i grant all the local account (that are not admin) as admin
for user in $(dscl . -list /Users uid | awk '{if ( $2 >= 501 ) print $1}');do /usr/sbin/dseditgroup -o edit -a $user -t user admin echo add $user from admin group done
that part is OK.
then I launch a remove framework:
sudo jamf removeFramework sleep 20
the remove framework works but not the sleep.....
Then, I delete then entry in the Jamf console with the serial number:
serial=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print $NF}') curl -k -s -H "Content-Type: application/xml" -u "$5":"$6" "$4"/JSSResource/computers/serialnumber/"$serial" -X DELETE
it work too
as explained everything is almost working:
grant user --> OK
removeFramwork --> OK
delete --> OK
but the sleep not, so in the device, it begin to remove the Jamf agent, but all profiles that have been push stay on it....
I think it's because it does not wait to receive the JSS order to remove them????
is there any error in the process?
thanks for your help
