Posted on 06-19-2015 04:25 AM
Where is the option of setting the names for PreStage Enrollment of OS X computers that enrol over DEP? We see the option of naming for mobile devices, but it's not there for computers.
Posted on 06-19-2015 06:29 AM
There is currently not a way of naming devices within the pre-stage enrollment. I have a script that sets the computer name based on the username upon first startup.
For computers we can automate names with a script but I assume we get to do it via a pre-stage enrollment on mobile devices since there isn't another automated way.
Posted on 06-19-2015 07:24 AM
@adamcodega do you mind sharing this script with us? I've been searching on here for something similar to this but haven't been able to find much.
Posted on 06-19-2015 07:30 AM
Sure thing it's on my GItHub.
The script can be pretty simple it just depends on your naming scheme. We like to use first initial last name to make it easy, so we pull that from the user full name. Then we set the computer name with the JAMF framework.
My script then uses CocoaDialog to ask the user (presumably an IT tech) which department to put the computer into and sets that using the JAMF framework.
Then we run a policy and recon refresh so software and printers install and the IT tech can install anything else via Self Service.
There's a few issues I need to investigate. One, I've heard using the JAMF framework to set the computer name isn't identical to using scutil three times.
sudo scutil --set ComputerName "newname" sudo scutil --set LocalHostName "newname" sudo scutil --set HostName "newname"
Secondly, I haven't added commands to the script to set system updates to install and to install any pending updates. I'll need to play with that to make the startup, see an update, install an update, continue where enrollment left off routine work well.
Posted on 06-19-2015 07:33 AM
Thanks, Adam. That will be a huge help.
Posted on 06-19-2015 07:39 AM
Oh, also, the CocoaDialog dropdown box needs a --height 150. I haven't pushed my changes to my GitHub yet.
Posted on 06-19-2015 10:22 AM
I specified how I've been handling it in the post below:
Posted on 07-07-2015 05:38 AM
@adamcodega we have a lot students with the same first initial and last name. How can we change the line that pulls the first initial to pull the full first name instead? I've been trying to figure this out and can't. This is the line below that I'm referring to. Thanks!
finitial="$(echo $name | head -c 1)"
Posted on 07-07-2015 10:41 AM
@gregleeper Head is being used to take out the first byte in the variable, meaning the first letter of the first name.
If you look at last name variable, we are using cut, telling it that a space is the delimiter with -d, and asking it to cut and then show us the second value, because we used -f 2
If you use -f 1 you'll get the first value instead, getting you the first name.
fn="$(echo $name | cut -d -f 1)"
Posted on 07-21-2015 11:33 AM
Thanks for explaining how you got those values. Learning this stuff can really help out in the future.