Posted on 08-07-2015 01:53 PM
Does anyone know how to do this?
I want to have an admin account setup and skip the rest of the setup.
https://discussions.apple.com/thread/2152439
Hello everybody
First of all I have Netinstall up and running. My Problem is however:
Everytime a client installs Mac OS X from a Netinstall Image, the Apple Setup Assistant pops up (for registration, mobileMe, and to create an Administrator Account!). I haven't found anything in System Image Utility that would disable the Setup Assistant. I don't really see the point of Netinstall anymore because of this.
How can I kill the Setup Assistant and instead run a script that would create a predefined Administrator account?
What I've tried:
Built a package that replaces "/System/Library/CoreServices/Setup Assistant/Contents/MacOS/Setup Assistant" with a bash script (also called Setup Assistant) that creates an Admin account with dscl.
However the Netinstall fails, and I can't find the problem?
Can anybody help me to get rid of this Setup Assistant ? Thank you very much!
Edit: The inspiration came from this thread http://discussions.apple.com/thread.jspa?messageID=8319142�
Message was edited by: Scotch22
MacBook, MacBook Pro, MacPro, ..., Mac OS X (10.6)
This solved my question Solvedby foilpan on Sep 10, 2009 6:33 AM
add a custom package or script in your workflow to touch the file /var/db/.AppleSetupDone, but be sure you have a script in there somewhere to either create or add the local user before reboot.
you'll find some helpful tips in the instadmg forum here: http://www.afp548.com/forum/index.php?forum=45
Posted on 08-07-2015 02:16 PM
Posted on 08-12-2015 10:27 AM
Now What about user creation. I use system image utility to create a user account but that doesn't seem to work for NetInstall. Any ideas?
Posted on 08-12-2015 10:45 AM
@kerickson: use MagerValp's (Per Olofsson's) CreateUserPkg
Posted on 08-12-2015 10:58 AM
I get this error trying to add the .pkg files
Posted on 08-12-2015 11:08 AM
What's int he pkg file you've made?
Posted on 08-12-2015 11:37 AM
I made a user account and the skip the apple setup both two .pkg files.
Posted on 08-12-2015 11:50 AM
In Yosemite you can create user accounts with sysadminctl
. I've blogged the process and all the other bits for our first boot script here: http://www.amsys.co.uk/2015/01/creating-first-boot-script/
Posted on 08-13-2015 05:53 AM
When I follow your guide for the scripts what format do I save them as.
Do they have to be part of a .pkg file to work. I got the admin account to work but now need to skip the iCloud,timezone and all of that stuff.
Posted on 08-21-2015 09:59 AM
David can you help me get the script customized?
I seems to need it to be part of a .pkg file to even run is there a way to just put in a script in system image utility.
Posted on 08-21-2015 12:07 PM
Hi @kericson
The script needs to be run on first boot of the new OS. If you are using Casper, you just add the script to the Casper Admin configuration and set it to run at reboot once the imaging has finished.
If you are using something like DeployStudio you can use that to run a postponed script.
Failing that, you would need to package it and run it via a LaunchDaemon that delete after completion.
Posted on 10-29-2015 06:40 AM
Is this any difference or changes with 10.11 El Capitain?
Posted on 10-29-2015 08:47 AM
SIP is the main difference so any parts that were writing into /System (or other SIP protected areas) will need to be replaced with something else. We're using config profiles for a lot of it now.
Posted on 10-29-2015 09:59 AM
I saw that same issue with some testing I was doing... I never follow up as I thought the .pkg I was using was old... maybe not flat?
I was thinking that it looks like in El Capitain Apple has really cleaned up System Image Utility, and that I should test a building an Netinstall with a JSS quick add .pkg in it..
However that is a long term plan/option and I needed to focus on getting El Capitain and FileVault working...
C
Posted on 11-11-2015 09:35 AM
This is what I tried on a 10.11 and nothing happened:
PLBUDDY=/usr/libexec/PlistBuddy
KEYBOARDNAME="English"
KEYBOARDCODE="1"
LANG="en"
REGION="en_US"
SUBMIT_TO_APPLE=NO
SUBMIT_TO_APP_DEVELOPERS=NO
update_kdb_layout() { ${PLBUDDY} -c "Delete :AppleCurrentKeyboardLayoutInputSourceID" "${1}" &>/dev/null if [ ${?} -eq 0 ] then ${PLBUDDY} -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.${KEYBOARDNAME}" "${1}" fi
for SOURCE in AppleDefaultAsciiInputSource AppleCurrentAsciiInputSource AppleCurrentInputSource AppleEnabledInputSources AppleSelectedInputSources
do
${PLBUDDY} -c "Delete :${SOURCE}" "${1}" &>/dev/null
if [ ${?} -eq 0 ]
then
${PLBUDDY} -c "Add :${SOURCE} array" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0 dict" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:InputSourceKind string 'Keyboard Layout'" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout ID integer ${KEYBOARDCODE}" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout Name string '${KEYBOARDNAME}'" "${1}"
fi
done
}
update_language() {
${PLBUDDY} -c "Delete :AppleLanguages" "${1}" &>/dev/null
if [ ${?} -eq 0 ]
then
${PLBUDDY} -c "Add :AppleLanguages array" "${1}"
${PLBUDDY} -c "Add :AppleLanguages:0 string '${LANG}'" "${1}"
fi
}
update_region() {
${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null
${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null
${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null
${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null
}
sysadminctl -addUser localadmin -fullName "Administrator" -UID 499 -password "password" -home /var/localadmin -admin
/usr/sbin/systemsetup -settimezone "Central Standard Time"
/usr/sbin/systemsetup -setusingnetworktime on
update_kdb_layout "/Library/Preferences/com.apple.HIToolbox.plist" "${KEYBOARDNAME}" "${KEYBOARDCODE}"
for HOME in /Users/
do
if [ -d "${HOME}"/Library/Preferences ]
then
cd "${HOME}"/Library/Preferences
HITOOLBOX_FILES=find . -name "com.apple.HIToolbox.
plist"
for HITOOLBOX_FILE in ${HITOOLBOX_FILES}
do
update_kdb_layout "${HITOOLBOX_FILE}" "${KEYBOARDNAME}" "${KEYBOARDCODE}"
done
fi
done
update_language "/Library/Preferences/.GlobalPreferences.plist" "${LANG}"
for HOME in /Users/
do
if [ -d "${HOME}"/Library/Preferences ]
then
cd "${HOME}"/Library/Preferences
GLOBALPREFERENCES_FILES=find . -name ".GlobalPreferences.
plist"
for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES}
do
update_language "${GLOBALPREFERENCES_FILE}" "${LANG}"
done
fi
done
update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}"
for HOME in /Users/
do
if [ -d "${HOME}"/Library/Preferences ]
then
cd "${HOME}"/Library/Preferences
GLOBALPREFERENCES_FILES=find . -name ".GlobalPreferences.
plist"
for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES}
do
update_region "${GLOBALPREFERENCES_FILE}" "${REGION}"
done
fi
done
systemsetup -setremotelogin on
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
sw_vers=$(sw_vers -productVersion)
for USER_TEMPLATE in "/System/Library/User Template"/* do /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}" /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}" done
for USER_HOME in /Users/*
do
USER_UID=basename "${USER_HOME}"
if [ ! "${USER_UID}" = "Shared" ]
then
if [ ! -d "${USER_HOME}"/Library/Preferences ]
then
mkdir -p "${USER_HOME}"/Library/Preferences
chown "${USER_UID}" "${USER_HOME}"/Library
chown "${USER_UID}" "${USER_HOME}"/Library/Preferences
fi
if [ -d "${USER_HOME}"/Library/Preferences ]
then
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}"
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}"
chown "${USER_UID}" "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant.plist
fi
fi
done
if [ $osvers -ge 10 ]; then CRASHREPORTER_SUPPORT="/Library/Application Support/CrashReporter" CRASHREPORTER_DIAG_PLIST="${CRASHREPORTER_SUPPORT}/DiagnosticMessagesHistory.plist"
if [ ! -d "${CRASHREPORTER_SUPPORT}" ]; then mkdir "${CRASHREPORTER_SUPPORT}" chmod 775 "${CRASHREPORTER_SUPPORT}" chown root:admin "${CRASHREPORTER_SUPPORT}" fi
for key in AutoSubmit AutoSubmitVersion ThirdPartyDataSubmit ThirdPartyDataSubmitVersion; do $PlistBuddy -c "Delete :$key" "${CRASHREPORTER_DIAG_PLIST}" 2> /dev/null done
$PlistBuddy -c "Add :AutoSubmit bool ${SUBMIT_TO_APPLE}" "${CRASHREPORTER_DIAG_PLIST}"
$PlistBuddy -c "Add :AutoSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}"
$PlistBuddy -c "Add :ThirdPartyDataSubmit bool ${SUBMIT_TO_APP_DEVELOPERS}" "${CRASHREPORTER_DIAG_PLIST}"
$PlistBuddy -c "Add :ThirdPartyDataSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}"
fi
/usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
spctl --master-disable
for USER_TEMPLATE in "/System/Library/User Template"/*
do
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1
done
for USER_HOME in /Users/*
do
USER_UID=basename "${USER_HOME}"
if [ ! "${USER_UID}" = "Shared" ]
then
if [ ! -d "${USER_HOME}"/Library/Preferences ]
then
mkdir -p "${USER_HOME}"/Library/Preferences
chown "${USER_UID}" "${USER_HOME}"/Library
chown "${USER_UID}" "${USER_HOME}"/Library/Preferences
fi
if [ -d "${USER_HOME}"/Library/Preferences ]
then
killall -u $USER_UID cfprefsd
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton
/usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1
fi
fi
done
Posted on 11-11-2015 10:46 AM
There are a few things that have changed in 10.11 so this script won't work properly on anything other than 10.10.
We (Amsys) are currently working on our 10.11 first boot script. We have a working version but its not quite ready for the public eyes of github ;)