Hey All! I have been working on a section of my provisioning script that names the computer then I'm using the built-in Jamf binding tool after the script runs so the proper name is used. The problem I'm running into is that from time to time the rename won't stick and it'll upload as [localadmin]'s Macbook Pro. Anyone else experienced this?
! /bin/sh
Prompt user to enter the machine name
MachineName="$(/usr/bin/osascript -e 'Tell application "System Events" to display dialog "Enter the Machine Name:" default answer "" with title "Rename Machine" with text buttons {"Ok"} default button 1' -e 'text returned of result')"
Set the ComputerName
sudo scutil --set ComputerName $MachineName
sleep 15
Set the LocalHostName
sudo scutil --set LocalHostName $MachineName
sleep 15
Set the HostName
sudo scutil --set HostName $MachineName
sleep 30
exit 0
