/build/static/layout/Breadcrumb_cap_w.png

Post-install scripting, can't screenshare with my Macs after install... HELP!

So, I have a post-install script that I sussed out from numerous web searches:
#!/bin/bash 

serialNumber=`ioreg -l | grep IOPlatformSerialNumber | awk '{print $4}' | cut -d \" -f 2` 

computerName="$serialNumber"
 
/usr/sbin/scutil --set LocalHostName "$computerName" 

/usr/sbin/scutil --set ComputerName "$computerName" 

/usr/sbin/scutil --set HostName "$computerName" 

sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist NetBIOSName "$computerName"

The intention for this script is to only have to touch the computer to start imaging.  After deployment, I want the script to automatically name the Mac by it's serial number and be able to access it via Apple Remote Desktop using serialNumber.local for address.  But ARD never sees the computer after reboot (image being deployed does have Remote Management enabled).  The script does rename the computer correctly which I can verify by logging in on the Mac to check it's name.  Also, when viewing the SystemConfiguration/preferences.plist, I see that the serial number is correctly set for each of the 3 names.  After taking the unit off of the imaging rack and connecting it to wifi, the unit does become available in ARD, but I noticed that the DNS name is some other random name (ch-aract-ers.ourschoolsdomain.org).  After poking around, I found that this was the NetBIOS name that was written in the /SystemConfiguration/com.apple.smb.server.plist file.  So, this is when I added the line to the script that changes the NetBIOSName.  Still, upon reboot after imaging, NetBIOSName is still some other name.  Oddly, it will assign the serial number as the NetBIOS name when take it off the rack and switch to wifi.  What I really need, though, is to not have to physically touch the Mac again after deployment.  I need to be able to do all post-imaging from within ARD.


Please help!!!!  I'm running out of time to figure this out!


3 Comments   [ + ] Show comments
  • Getting the serial number is faster with:

    system_profiler SPHardwareDataType |awk '/Serial Number/ {print $4; }' - MacDude 9 years ago
  • Thank you! I do appreciate efficiency. Any thoughts on how to successfully access via Apple Remote Desktop after imaging? - atoss 9 years ago
  • Are you running kickstart to turn it on?

    http://support.apple.com/kb/HT2370?viewlocale=en_US&locale=en_US

    the computer name may be a red herring - MacDude 9 years ago

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ