Posted on 04-03-2015 08:44 AM
I have a policy that runs at Enrollment Complete for DEP enrolled machines. The policy contains a .pkg with a postinstall script that prompts the tech for a computer name and then names the machine using scutil --set ComputerName, HostName and LocalHostname. I've also tried adding jamf -setComputerName and networksetup -setcomputername to the script. After the script runs I check all of those locations via terminal and all return the new, correct name.
The policy also includes a JAMF Directory Binding for Active Directory. When this policy runs it binds the machine to AD using the previous computer name.
My question is: Where does the JAMF Directory Binding task pull the computerID info from for the bind?
Posted on 04-03-2015 08:45 AM
Are you sure that the AD bind is happening after the computer name change and not before?
Posted on 04-03-2015 08:49 AM
According to the logs, the Name Change is the first thing to happen (as it should because I've given it a priority of 2), then other software is installed, scripts are run, and then the AD bind happens at the end. The terminal checks that I've done were while the additional software was being installed, after the name change and before the bind.
Posted on 04-03-2015 09:22 AM
I was just working on this earlier this week.
So it turns out that the JAMF Directory Bind takes the hostname at the START of the policy execution as the name to bind it with.
I ended up making two policies to solve this:
1) Runs the Computer name prompt/change script then calls a jamf policy custom trigger to a policy
2) Sets to execute at the custom event to perform the binding.
Posted on 04-06-2015 09:22 AM
Thanks Marker.43
Posted on 04-06-2015 10:31 AM
Yes, thanks @Marker.43. I did modify my naming policy to call another policy to perform the bind, and it works ok.
Posted on 11-11-2015 08:24 AM
Hi @bharris, I am new to DEP and am now facing a similar Computer Name problem to the one mentioned in this discussion. Would you be able to share your postinstall script that prompts the tech for a computer name? I would like to use it as part of my imaging process. Thanks.