Computer Names not being applied

FDA
New Contributor

When imaging 2 specific computers that worked fine a few days ago with Casper imaging the name is not being applied causing some of the post run scripts not to run. Ive tried deleting the Autorun data, deleting the machine info all together and nothing appears to be working another computer works fine with the same image, anyone have any idea whats going on?

11 REPLIES 11

justinworkman
Contributor

Do you have an old prestage lingering around?

FDA
New Contributor

No prestages were ever created

wdfraser
New Contributor

I am having the same problems. Two computers that I use for testing frequently just started having issues during imaging, not applying the computer name. Imaging both Lion and Snow Leopard. Reset auto run data as well to no effect. No prestages.

frozenarse
Contributor II

Where are you seeing the incorrect computer name? In the JSS inventory? Are you renaming an existing computer that is already being managed?

FDA
New Contributor

System Preferences, Terminal, JSS

frozenarse
Contributor II

I noticed that my hostname (terminal) wasn't matching up with what was in JSS. It was always getting that value from whatever DNS was using at the time. I just stuck a script in the configuration that sets the hostname at re-image time. Sounds like it might be a different issue than yours.

wdfraser
New Contributor

I fixed the issue on my end. When I create my base images, I clear out the SystemConfiguration folder. On my last go, I deleted the folder. Naming of the computers works fine if you have an empty folder, but fails if the folder is absent. The naming script assumes the folder exists and fails out if it does not.

CasperSally
Valued Contributor II

<<I noticed that my hostname (terminal) wasn't matching up with what was in JSS. It was always getting that value from whatever DNS was using at the time. I just stuck a script in the configuration that sets the hostname at re-image time. Sounds like it might be a different issue than yours.>>

can you share this script?

frozenarse
Contributor II

It's actually just a line in a bigger script that runs on all computers at imaging time as part of the configuration.

I'm just using "scutil --set".

#### bit of script ####
scutil --set HostName $2
########################

$2 is the JAMF variable reserved for computerName

CasperSally
Valued Contributor II
I'm just using "scutil --set".

So simple - thanks!

mm2270
Legendary Contributor III

Keep in mind that scutil --get/set HostName is not necessarily setting the "Computer Name" These are not necessarily the same thing nor do they need to be.

For example, I can use

sudo scutil --set HostName 12345

which will set that up for my Mac. I can then verify this by using either:

scutil --get HostName

or just running

hostname

In contrast, running-

system_profiler SPSoftwareDataType | awk -F": " '/Computer Name/{print $NF}'

will return the Computer Name as entered in the Sharing tab for my computer and not "12345" If I'm not mistaken the jamf binary will pull the Computer Name similar above and send that back to the computer record in the JSS during a recon.

Also, in an AD environment, often the hostname is set to something like "thiscomutername.domain.company.com" where "thiscomputername" is usually the name in Sharing unless it was specifically modified with something like the commands above.
Its all a little confusing (the Windows admins I work with think its preposterous there isn't just one possible hostname for a Mac), but I would try running all of these commands on your systems and see what results get returned. Compare them to what you see in the Sharing tab's Computer Name field. The examples I'm giving apply to our setup, but you may get different results of course.

scutil --get ComputerName

scutil --get HostName

scutil --get LocalHostName