So as part of our enrollment process, we change the dock using dockutil. With our DEP machines, we also "Create an additional local administrator account" (UID 501)
However, if I log out of the account that a typical employee would create/use (UID 502...and dockutil works just fine on this user)...and log back in as our admin user (UID 501) that is created as part of DEP...the dock is not changed.
Any ideas as to why or how to get the admin account the same dock? Is it because the user is not logged into before running the dockutil command?
The script I run as part of one my policies:
#!/bin/bash
DOCKUTIL=/usr/local/bin/dockutil
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");')
# remove default apps
$DOCKUTIL --remove all --no-restart --allhomes
# add items to dock
$DOCKUTIL --add /Applications/Safari.app --position 1 --no-restart --allhomes
$DOCKUTIL --add /Applications/Preview.app --after Safari --no-restart --allhomes
$DOCKUTIL --add /Applications/Calendar.app --after Preview --no-restart --allhomes
$DOCKUTIL --add /Applications/Microsoft Outlook.app --after Calendar --no-restart --allhomes
$DOCKUTIL --add /Applications/Microsoft Word.app --after "Microsoft Outlook" --no-restart --allhomes
$DOCKUTIL --add /Applications/Microsoft Excel.app --after "Microsoft Word" --no-restart --allhomes
$DOCKUTIL --add /Applications/Microsoft PowerPoint.app --after "Microsoft Excel" --no-restart --allhomes
$DOCKUTIL --add '/Applications/System Preferences.app' --after "Self Service" --no-restart --allhomes
$DOCKUTIL --add '/Applications' --view auto --display stack --sort name --section others --position 1 --no-restart --allhomes
$DOCKUTIL --add '~/Documents' --view auto --display stack --section others --position 2 --no-restart --allhomes
$DOCKUTIL --add '~/Downloads' --view auto --display stack --sort dateadded --section others --position end --allhomes
exit 0