system_profiler | grep 'Hardware UUID' | cut -d " " -f 9
will return your UUID. Plop that in a script with some mv commands and you should be good to go. Off to a meeting at the moment, but if you need a hand, let me know.
same deal here although our isolating the UUID is slightly different than the esteemed mr. nichols. our issue was pre-setting the Java Prefs application to have the "Enable WebApps" button checked. our process:
1) snapshot the file you need on a machine that's already on and working the way you like.
2) lay the file down in a build and - on first boot - rename it with the correct UUID tag.
3) do that for all visible user accounts, i.e., those over UID 500
Our script looks big for what it is, but the log it produces is awfully nice.
Enjoy...
#!/bin/sh
# ---------------------------------------------------------
# SCRIPT INFO
#
# this script renames the java prefs on a mac for all users
# to include the UUID info into the new name of the file
# ---------------------------------------------------------
# ------------------
# variables
# ------------------
SCRIPTNAME=$0
LOG="/Library/Logs/Getty Installations.log"
over500=dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }'
UUID=ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, """); printf("%s
", line[4]); }'
echo " " >> $LOG
echo "###################################" >> $LOG
echo "########## Beginning Log ##########" >> $LOG
echo "##### Turning on Java WebApps #####" >> $LOG
echo "###################################" >> $LOG
echo " " >> $LOG
echo `date "+%A %m/%d/%Y %H:%M"` >> $LOG
echo Script: $SCRIPTNAME >> $LOG
echo " " >> $LOG
# --------------------------------------------------
# set script to loop through all users > 500
# --------------------------------------------------
for i in $over500
do
echo "----------------------------------------" >> $LOG
echo " FOR THE USER ACCOUNT: $i" >> $LOG
echo "----------------------------------------" >> $LOG
if [ -d /Users/$i/Library/Preferences/ByHost/ ]; then
cd /Users/$i/Library/Preferences/ByHost/
mv com.apple.java.JavaPreferences.*.plist com.apple.java.JavaPreferences."${UUID}".plist
echo "pList name of the JavaPrefs plist " >> $LOG
echo "has been changed for the $i account..." >> $LOG
echo " " >> $LOG
fi
done
echo " " >> $LOG
echo "###################################" >> $LOG
echo "########### Ending Log ###########" >> $LOG
echo "###################################" >> $LOG
echo " " >> $LOG
exit 0
Cool Thanks so much!! That is exactly what I am looking for have about 5 different by host prefs that need to be you know "renamed"
@jarednichols I got that far just needed to go one more step, it was 8pm at night and thought I would ask the community!
Thanks
Just a small update: in 8.52 it looks like it is working again: it uses UUID if you do a
jamf fixByHostFiles -target /
exit 0
I'm seeing ByHost issues post imaging with 8.52, but only (so far from my testing) on non unibody macbooks. If I run jamf fixByHostFiles on the effected machines, it errors out.
Emailed JAMF support.