Enrolment stuff

gracoat
New Contributor

Hey everyone! This MUST have been discussed, but to be honest, I've tried searching for it, and my use case is a little outside what I think is 'normal?'

I'm simply trying to test a script that needs to run FIRST during the enrolment process. As is common when scripting, wee mistakes cause the execution to fail. The problem is, if the script fails, I might as well not even finish the enrolment process.

Does it really mean that I need to reformat my hard drive and re-install macOS each time I want to test this??? Yeah, I can run it in the command line on a test bench machine, but the whole process of re-enrolling is maddeningly slow! Someone PLEASE tell me there's a way to get the computer to re-enrol without reformatting the hard drive. There used to be a method where deleting the user from dscl then removing the home folders, then removing the .setupcomplete file from somewhere in etc, but the computer STILL thinks it's enrolled.

My experience is telling me that the only way is to reformat the whole computer. ...and that just stinks when just trying to test an enrolment profile.

Help!

-Graham

1 REPLY 1

PaulHazelden
Valued Contributor

Have you tried the command line to enroll

jamf help enroll

Usage:   jamf enroll [-prompt | -invitation] [-noRecon] [-noManage]


     -prompt         Prompts for JSS and SSH credentials.

     -invitation         Uses an invitation ID for credentials instead of a user name and password.

     -noRecon        Stops enroll from acquiring inventory.

     -noManage       Stops enroll from enforcing the management framework.

     -noPolicy       Stops enroll from checking for enrollment policies.

Return Codes: 
     0        The enrollment process has succeeded.
     70       An error occurred while enrolling a computer.
     71       An error occurred while submitting an inventory after enrollment.
     72       An error occurred while running a manage command after enrollment.
     73       An error occurred trying to load the task that executes Enrollment Complete policies in the background.
     74       An error occurred while gathering inventory data in the background.
     75       An error occurred while sending enrollment information to Jamf Pro.

jamf enroll will enroll a computer, or re-enroll it too.

jamf help manage

Usage:   jamf manage 



Notes:   This verb enforces the entire management framework from the JSS, 
     including scheduled tasks, the restricted applications, and the Global Management settings, such as the startup 
     script and login/logout hooks.

This might help as well.