Mac name pop up pre-installation task
Does anyone have a pre-installation and mid-level tasks to prompt for a Mac computer name and apply it as part of the deployment process? We have these already scripted for Windows deployment and are looking to add this to the Mac process as well.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
WooLian
6 years ago
Below is a preinstallation Mac OS X shell script task that can be sampled in a test environment, however, I can not promise this will work as I have not tested it. Others participants here can also test and provide community assistance if necessary. Otherwise, my recommendation is to contact QUEST KACE Professional Services, as this is really their expertise.
This should prompt for a computername, then write the name out to a file. The file output should be /opt/kace/petemp/${MAC}. MAC being the MAC address of the client computer. The apply Mac OS X computername (the normal script) should write that out to the plist. That's it, hope this works or at least provides a good direction for you work with!
#!/bin/bash MAC=`/usr/sbin/networksetup -getmacaddress Ethernet 2> /dev/null | awk ' { print $3; }' | sed -e s/://g` TEMP_PATH="/opt/kace/petemp/${MAC}" IFS=$'\n' volume=`mount | grep -m 1 disk0` zeroMount=`echo "$volume" | awk '{ print substr($0,index($0, "on ")+3,index($0, "(")-index($0, "on ")-4) }'` # prefPath=${KACE_SYSTEM_DRIVE_PATH}/Library/Preferences/SystemConfiguration/preferences.plist # tComputerName=`/usr/libexec/PlistBuddy -c "Print System:System:ComputerName" $prefPath` # computerName=`echo $tComputerName | awk '{ print index($0,"Not Exist") }'` # if [ x$computerName == x0 ]; then # computerName=$tComputerName # else # computerName="localhost" #fi echo -n 'Computername: ' read computername echo $computername echo $computerName > "${TEMP_PATH}" exit 0 |
Comments:
-
How To Contact QUEST KACE Professional Services (176023)
https://support.quest.com/kb/176023 - WooLian 6 years ago