I am fairly new to managing Macs with JAMF. We are attempting to both name and bind the computers to AD with policies during enrollment. The issue we run into is, our naming script works, however, when the computers bind to the domain the NetBIOS name reverts to something different from the LocalHostName which causes the computers to bind to the domain under a different name. Here is the script we are using to name the computers:
!/bin/sh
defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool YES
computerName=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}')
prefix=$"M-"
echo $prefix$computerName
scutil --set HostName $prefix$computerName
scutil --set LocalHostName $prefix$computerName
scutil --set ComputerName $prefix$computerName
jamf Recon
exit
Any help or insight would be greatly appreciated!
Thanks,