Im very new in the mac and jamfworld so please correct me if im totalty off here. Im just trying to find the best solution!
Im enrolling clients for a customer that requires rename prior to AD Bind and i solved that by having only two policys triggered after Enrollment, create a special local account and rename computer using script below and then a restart is invoked and at next login the AD Bind will trigger, also based on Smart Group(not bound). This is is the only way i managed to secure that the computer name was correct prior to bind. This is important to us since the SCEP payload that is pushed from CA to clients, triggers at bind, must have correct id when assigning certificates used for corporate access (vpn etc).
#!/bin/sh
## SET COMPUTERNAME
NUMBER=`ioreg -l | awk '/IOPlatformSerialNumber/ { print $4;}' | cut -c 2-13`
## USE SERIALNUMBER FOR COMPUTERNAME
AD_COMPUTERNAME=$NUMBER
## SET NAME IN NETWORK PREFS
sudo scutil --set ComputerName $AD_COMPUTERNAME
sudo scutil --set LocalHostName $AD_COMPUTERNAME
sudo scutil --set HostName $AD_COMPUTERNAME
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$AD_COMPUTERNAME"
exit 0