Posted on 10-08-2021 09:14 AM
I'm trying to reset the dock to default via Self Service policy using the following execute command in files and processes
defaults delete com.apple.dock; killall Dock
it does nothing to the users dock that ran the self service policy!!! itjust makes the dock briefly disappear and then re-appear (refreshing).
anyone have a policy that can re-create the default dock for the user that executes the policy via Self Service?
Posted on 10-08-2021 09:20 AM
Try adding a period to the end of the domain like this: com.apple.dock. See if that helps. I also like to put a space at the end of my first command, then the semicolon, then another space. I do that just to make sure I'm explicit with my terms. So I'd do it as defaults delete com.apple.dock. ; killall Dock
Posted on 10-08-2021 09:37 AM
@tcandela if you’re running that exact defaults command then the only plist you’re deleting is the one for the root account. To do this effectively you need to direct the command to the logged in users Dock plist. So something like
defaults delete /Users/$loggedInUser/Library/Preferences/com.apple.dock.plist
...should delete the correct plist.
Posted on 10-08-2021 02:16 PM
@mm2270 so do i just put in the command that you specified and nothing else? no ; Killall Dock
Posted on 10-11-2021 09:47 AM
@AVmcclint @mm2270 I just want the current logged in users dock to be set back to the default dock. The user will go into self service and execute the policy.
I'm going to try the command that @mm2270 posted wich is below, but do I need to add the ' ; Killall Dock' to the end of it?
defaults delete /Users/$loggedInUser/Library/Preferences/com.apple.dock.plist
Posted on 10-11-2021 01:39 PM
Yes you need to also issue a killall Dock otherwise the plist won't be regenerated.
Posted on 10-17-2021 08:40 AM
@mm2270 hi, the command to reset the logged in users dock does not work. Here are screenshots of the policy and the log entry for the computer that the policy ran from (self service policy). Users dock remains the same.
Posted on 10-18-2021 05:45 AM
Try changing your variable to say $3 for instance. Unless I'm missing something but I believe $loggedinuser would require you run this in a script to capture that logged in user variable.