Dockutil Command w/o Separate Script

ChickenDenders
New Contributor III

Hello!

I'm trying to find a solution for attaching Dockutil commands to a policy. I want to embed the command within the policy, instead of creating a separate script for just adding one icon to the dock. I expected to be able to make a one-banger command on a per-Application basis through Files and Processes > Execute Command within the policy options, but I haven't yet been successful.

Here's what I'm throwing in now. I don't know how the syntax compares to creating a bash script. I think my hangup revolves around the command running as Sudo, instead of the current user.

/usr/local/bin/dockutil --add /Applications/DaVinci Resolve/DaVinci Resolve.app --before 'Fusion' "/Users/$3"

Fomr the logs...

Running command /usr/local/bin/dockutil --add /Applications/DaVinci Resolve/DaVinci Resolve.app --before 'Fusion' "/Users/$3"... Result of command: /Users/Library/Preferences/com.apple.dock.plist does not seem to be a home directory or a dock plist

Right now I'm just testing this with an ongoing policy triggered by Self Service. The application I'm deploying (DaVinci) takes too long for this to reasonably be deployed as a login item, so I think I'll ultimately set it to recurring/once per user. That way, they'll already be logged in when it runs.

Any recommendations?

1 ACCEPTED SOLUTION

ChickenDenders
New Contributor III

Right after I posted this, I changed the last bit of the command and got it working :)

.....  --before 'Fusion' "/Users/$3"

changed to

..... --before 'Fusion' --allhomes

View solution in original post

2 REPLIES 2

ChickenDenders
New Contributor III

Right after I posted this, I changed the last bit of the command and got it working :)

.....  --before 'Fusion' "/Users/$3"

changed to

..... --before 'Fusion' --allhomes

ChickenDenders
New Contributor III

[deleted double post]