Posted on 06-24-2020 03:59 PM
Hello all,
Still getting up to speed on Config Profiles as I know they are the future,
I wanted to know if there is a template or existing way to create Aliases (symlinks) of applications to every users Desktops. My search here at JN was not fruitful.
I am sure it is easy, I am just not sure how to get there yet.
TIA,
/randy
Posted on 07-01-2020 03:15 PM
You could use the dock payload. That's what we do to make obvious shortcuts for certain classes.
Posted on 07-01-2020 04:16 PM
Hi @Randydid,
Once your file is in the desired location, you can lock down it's setting using:
#Change owner to root
sudo chown root:wheel <file>
#Adjust permissions to read only for all users
sudo chmod 444 <file>
#Lock the Alias file to prevent future changes
sudo chflags uchg <file>
Posted on 07-02-2020 09:58 AM
ln -s /path/to/original /path/to/destination
still works (even on that most recent developer release). Use outset
or similar to run at login.
Posted on 06-02-2021 02:59 PM
Thank you for this thread and for the suggestion pete_c
That script works like a charm run directly in Terminal when entering this:
ln -s /Applications/Self Service.app /private/var/$USER/Desktop
Adding this as a script in the JSS and trying to push it via Jamf Remote (or login hook) initially succeeds according to the log, but doesn't display an alias.
Trying to push it a second time results in an exit error:
ln: /private/var/root/Desktop/Self Service.app: File exists
It looks like the alias is being created but on the desktop of Root instead of the currently logged in user.
Is there a way to have $USER not recognize that root is being used in order to run the script (if I'm reading right, Jamf always runs scripts as root)?
(I'm a bit new to scripting so I might be missing something super obvious or just misunderstanding everything entirely.)
(Edit - I was a goof and didn't think the script through carefully - this addition seems to have gotten the desired result for Self Service at least:
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
ln -s /Applications/Self Service.app /Users/$loggedInUser/Desktop
Seems like it should be adaptable for other applications and could even be used as a post install script for something installed with a login trigger. )