Setting path to user via execute command

lsv
New Contributor III

This could be a relatively silly question, but I'm trying to run the following command to turn off Slack's auto update feature:

 

defaults write /Users/$USER/Library/Preferences/com.tinyspeck.slackmacgap SlackNoAutoUpdates -bool YES

 

I'm planning on running the command via the Files and Processes > Execute Command section of a policy. I know with scripts $3 typically defaults to username, but does this also translate over to commands setup this way? Essentially I'm trying to figure out the best way to set the path to to the currently logged in user.

 

Thanks!

2 REPLIES 2

Jalves
Contributor

I would use a configuration profile to manage this if possible. Slacks documentation points to those defaults commands, but uploading that plist via a Jamf Custom Configuration Profiles or by using the ProfileCreator App is probably easier ongoing. Once scoped, you should get that file where you need it with some level of enforcement if you decide to do so.

lsv
New Contributor III

Ahh good to know! Thank you!