Posted on 07-11-2019 03:09 AM
I am preparing a script (based on the famous CasperCheck by @rtrouton) to ensure devices are correctly enrolled and fix them if something is missing.
However, I keep getting an error when the script runs this line:
jamf enroll -invitation $invitationCode -noRecon -noPolicy
The enrollment in fact goes well, and the the device ends up working as expected, but I get the following error:
7170 Illegal instruction: 4 jamf enroll -invitation $invitationCode -noRecon -noPolicy
Strangely, if I run the command on the Terminal, I don't get the error.
I've checked here and there, and it seems that the error is more related to dylibs that the script, of course, is not touching.
Has any of you came across this kind of problem?
Posted on 07-11-2019 07:45 AM
I'd print out the Invitationcode with an echo command. I might also put it in quotes just to see what it looks like.
Posted on 07-12-2019 12:31 AM
I tried with quotes on and off, doubles, singles, curly braces… everything but doing an echo there, so I'll try that now.
Posted on 07-15-2019 07:56 AM
Echo will just let you see that something valid is in the enrollment invitation- to make sure there's not bad characters or no content!
Are you using the correct dash for NoRecon and noPolicy? – — - are three different dashes. You might want to try without the noRecon and noPolicy just to see if the error goes away? -t-
Posted on 07-16-2019 01:23 AM
In fact, I know that the command ends up working correctly (invitation, options and all) because the machines end up enrolled as expected…
So I suppose it's only an error that shows on the stdout, and it comes from one of the tasks that the enroll command triggers, rather than from the command itself.