JSS 9.73 and OS X 10.10.3 or higher.
This is rather strange behavior and I'm curious if others are seeing this and if so what they are doing to work around it.
Basically, I have a brand new Mac that has never been enrolled to the JSS. I netboot it and use Casper Imaging. I use a config that is 'thin' and I am not wiping the drive but rather just putting a few packages that run on first boot. On my first boot package, I have the following in the postinstall script.
Note: the computers in question are 2015 MacBook Airs using Thundetbolt to Ethernet adapters that I'm noticing this on.
jamf="/usr/sbin/jamf"
# Detects the ethernet adapter
/usr/sbin/networksetup -detectnewhardware
sleep 30
#########
#Create a check so that a connection to the JSS is established before proceeding.
#########
"$jamf" checkJSSConnection
#If the exit code of the JSS connection check is 1 then we'll try again for 5 minutes (5secs*60=300)
if [ "$?" != "0" ]; then
"$jamf" checkJSSConnection -retry 60
fi
if [ "$?" != "0" ]; then
/bin/echo "JSS cannot be contacted."
#Check JSS Connection again
"$jamf" checkJSSConnection
if [ "$?" != "0" ]; then
#Forcing a reboot so that computer can re-attempt to do Casper Enrollment successfully.
/sbin/reboot
fi
fi
Without the JSS check the computer NEVER enrolls. However with the JSS check built-in the computer does enroll (I'm guessing because it tries to check the connection for 5 minutes), but it does not show up as managed. If it doesn't show up as managed in the JSS the computer cannot run policies which obviously becomes a problem.
The weird thing is that other computers that have been enrolled into the JSS do not exhibit this problem if they are being re-imaged. And in fact, if I take the same machine and netboot and do the same image config a second time it works fine.
Later on in the script, I have it doing the following with the idea that this would cause the computer to be managed, but no cigar:
#Enable management of computer by JSS
"$jamf" manage
Unless I'm missing something, shouldn't this cause the computer to be managed within the JSS?
Let me know if you have any questions.