Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockutil Does not change all homes #81

Open
Dfree2 opened this issue Jan 25, 2019 · 1 comment
Open

Dockutil Does not change all homes #81

Dfree2 opened this issue Jan 25, 2019 · 1 comment

Comments

@Dfree2
Copy link

Dfree2 commented Jan 25, 2019

Hi,

First off, great tool and thank you for developing it and supporting it.

I posted this on Jamf Nation first, but here is the copypasta:

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) which is a feature of Jamf.

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?

I have had the same problem on all versions of High Sierra and all versions of Mojave including the just released 10.14.3. We're been on Jamf 10.9.0 for awhile now if that matters at all.

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 + "\n");')

# 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
@mvught
Copy link

mvught commented Jan 25, 2019

Hello Dfree,

We use a script like this and it works with all users:
DockUsers.txt
maybe you can do something with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants