DEP and computer names

mconners
Valued Contributor

Hi Folks,

We have our DEP setup in our JSS and the computers and the iPads are all showing up just fine. What I am struggling with is the computer name piece. I know we can assign names based on serial number, MAC Addresses or a list of computer names.

Am I missing something because I don't see how the computer names list is supposed to work. I can see the list from Apple and I can reconcile this with our inventory of new equipment so I know what asset tag is assigned to what computer and its serial number.

So with that in mind, how do I create this computer list and what are the requirements of the list so I can use it appropriately? Anyone else using DEP with their JSS? I know I have to name the computers correctly in order to bind them to AD.

Thanks

5 REPLIES 5

joshuasee
Contributor III

I've struggled with this as well, particular since the _mbsetupuser means you can't count on GUI access to prompt a technician for a name during automated enrollment. Right now I'm generating temporary names with a script, and then changing them once enrollment is completed, accepting that the AD name won't necessarily match.

If you're not averse to scripting and slugging the names into a file somewhere, you could use the jamf setComputerName -fromFile feature.

There are feature requests related to this dealing with this problem, so there is likely to be a more elegant solution in the future.

stevewood
Honored Contributor II
Honored Contributor II

@mconners I think you are mixing two different things up: DEP and PreStage Imaging. With DEP there is no way that I know of to provide a list of serial numbers, MAC address, or computer names to name a computer. However, there is that mechanism with PreStage Imaging.

Currently, as far as I know, there is no way to pre-populate names for your devices in DEP. I may be wrong about that, but I've checked my DEP workflow, and I do not see a way.

The only method would be to do something like what @joshuasee mentioned, and script the naming of the computer. Depending on your naming convention, you could use a Policy set to trigger on "Enrollment Complete" and re-name the computer before binding to AD.

ImAMacGuy
Valued Contributor II

we setup a self service policy, the machine is enrolled, self service auto-open, they go to the section and runs the Self Service policy, which prompts for computer name stuff, it's worked pretty well for us.

mconners
Valued Contributor

Thank you for feedback, this has been helpful.

Steve, you are right, I think I may have been mixing the two of the things together and I didn't mean to do that. We can easily grab a Mac off the list and add it to the workflow and all works well. It is during the pre-stage imaging phase that is causing some angst as you have mentioned.

John, is there any chance you could share your workflow/script for naming the Macs via self service? Just curious how you have it working.

Thanks again!!

mick

ImAMacGuy
Valued Contributor II
#!/bin/bash
#Freddie Cox for Knox County Schools
#Edited by Justin Ellis
#2012

COUNTRY=`/usr/bin/osascript <<'EOT'
 tell application "System Events"
    activate
    set COUNTRY to text returned of (display dialog "<enter dialog here>" default answer "" with icon 2)
end tell
EOT`
REGION=`/usr/bin/osascript <<'EOT'
 tell application "System Events"
    activate
    set REGION to text returned of (display dialog "<enter dialog text here> "" with icon 2)
end tell
EOT`
MODEL=`/usr/bin/osascript <<'EOT'
 tell application "System Events"
    activate
    set MODEL to text returned of (display dialog "<enter dialog here>" default answer "" with icon 2)
end tell
EOT`
TAG=`/usr/bin/osascript <<'EOT'
 tell application "System Events"
    activate
    set TAG to text returned of (display dialog "<enter dialog>" default answer "" with icon 2)
end tell
EOT`

ComputerName=$COUNTRY$REGION$MODEL$TAG

#Set New Computer Name
echo $ComputerName
scutil --set HostName $ComputerName
scutil --set LocalHostName $ComputerName
scutil --set ComputerName $ComputerName

echo Rename Successful