Skip to main content

During Prestage Enrollment I am successfully running the rename computer script as a policy and it binds to AD.

Is it possible to have it run during the setup assistant or at the login screen?

The issue I face is with our naming convention. I need to rename the Mac and then bind to AD Prior to first login.

Currently it renames and binds but only after I log into a local account created be prestage enrollment.

I need it to prestage enroll, rename the Mac, then join to AD. If it does not rename and bind to AD the user will not be able to login with AD credentials but the script doesn't seem to run until a local user is logged in.

The idea is for this to be an automated process. I cannot give out the local account password to users so that it will finish enrollment policies.

If you're just looking for an easy way to set the computer name during Setup Assistant, take a look at my bash script that uses AppleScript to popup a dialog box to set the computer name. You'll need to attach this script to a policy that runs on the enrollment trigger. Then, when in Setup Assistant, stay at the Time Zone selection screen until you see the computer name dialog pop up (it can take 30 seconds or so).

Also, if you want to bind to AD just add some dsconfigad code to the bottom of script.

https://github.com/cwmcbrewster/Jamf_Scripts/blob/master/Computer_Enrollment_PromptForName.sh


Hey @cbrewer -- New to Jamf myself and was wondering if this can be modified to simply function after the enrollment process thereby affecting the computer name for those that aren't worried about timing or binding to AD?  


Hey @cbrewer -- New to Jamf myself and was wondering if this can be modified to simply function after the enrollment process thereby affecting the computer name for those that aren't worried about timing or binding to AD?  


Most of our deployments are Zero Touch so I can't guarantee that people will wait on the Time Zone selection for 30-60sec. I have been trying to find a solution where the user will be prompted to enter their name soon after account creation, thereby changing the computer name. 


@csanche3x Is the policy running successfully? What do the policy logs say? Are you waiting at the time zone setup assistant screen?

Do you have "Automatically install a Privacy Preferences Policy Control profile (macOS 10.14 or later)" enabled in Settings > Computer Management > Security?


@cbrewer Hi, thank you so much for the script and continued support. Apologies, if this is a basic question, but I have been getting the following error when running the script.

Executing Policy Computer Name
Running script Computer Name...
Script exit code: 0
Script result: Logged in user is not _mbsetupuser. Exiting...

I've tried searching the error, but I get no relevant information. Any advice or suggestions?

Thank you!