As I understand it, there may be hope in the next version of the Casper Suite to put this issue to rest...for now. In the mean time, although you all have some wonderful ways of doing this, I went an even more different route since I bind to AD and that part of the FirstRun works every time since the bind script in FirstRun uses the name in the script. =D
It's probably a terrible way to do it, but I read the computer name out of the AD settings at whatever point works and then pass that through to scutil. I found it more reliable to have a simple script part of first run that calls a custom triggered policy. The policy it calls installs a self-deleting StartupItem with the script below. After FirstRun finishes and reboots, the StartupItem runs and does the rest and then cleans itself up. You wouldn't need to output it to a file like I do, that I use for later reboots where another StartupItem renames the computers back to what they were when they were imaged to maintain the same name, you know the stupid (1) and (2) after the names, etc. I run another enroll command to make sure it does, that's been spotty as hell, too.
TEST TEST TEST, and if you have any questions, let me know. Thanks for all the responses folks!
YOU MUST CHANGE your plist file name, since it won't be UWEC like mine. Also, if you have a preference on computer name case, you'll have to work around that, too.
#!/bin/sh
## Delete an existing computername.conf file if it already exists
if [ -f /private/var/computername.conf ]; then
/bin/rm /private/var/computername.conf
fi
## Create new computername.conf file using AD binding information, and then set the computer name
if [ -f /Library/Preferences/OpenDirectory/Configurations/Active Directory/UWEC.plist ]; then
defaults read /Library/Preferences/OpenDirectory/Configurations/Active Directory/UWEC.plist trustaccount | sed '$s/.$//' > /private/var/computername.conf
set_name=`/bin/cat /private/var/computername.conf`
/usr/sbin/scutil --set ComputerName $set_name
/usr/sbin/scutil --set LocalHostName $set_name
jamf enroll
fi