Posted on 11-09-2022 03:26 PM
Hey all!
I'd like to have an alias that points to Self Service available on the desktop of all Macs across our fleet.
I guess there are several ways of doing this. Just looking to get some ideas on what a quick and easy method would be.
Thanks!
Solved! Go to Solution.
Posted on 11-10-2022 11:37 AM
I simply made a policy to do this. Added under "Files and Processes":
ln -s /Applications/Self\ Service.app ~/Desktop
Posted on 11-13-2022 04:47 PM
I went with this in the end: created a script and got the policy to deploy it. The script contents being:
#!/bin/sh
sudo -u $3 ln -s /Applications/Self\ Service.app /users/$3/Desktop
The key thing here being the $3 parameter, which Jamf defines as the current logged on user.
Thanks for the assistance, jamfers!
Posted on 11-10-2022 01:52 AM
@SteveWalker . You can test and try.
For currently logged in user
loggedinuser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
cp -R "/Users/Shared/IBM/IBM i Access" /Users/$loggedinuser/Desktop/
For all users
Exsiting Users
for userLogged in $(/bin/ls /Users | sed -e '/Shared/d' -e '/Deleted Users/d' -e '/.localized/d'
-e '/.DS_Store/d' -e '/.com.apple.timemachine.supported/d' -e '/Adobe/d' -e '/Library/d');
do
ln -s /Applications/Self\ Service.app /Users/$userLogged/Desktop/SelfService
chown -R $userLogged:staff /Users/$userLogged/Desktop/SelfService
done
Future Users
ln -s /Applications/Self\ Service.app /System/Library/User\ Template/English.lproj/Desktop/SelfService
/usr/sbin/chown -R root:wheel /System/Library/User\ Template/English.lproj/Desktop/SelfService
Thanks
Posted on 11-10-2022 11:37 AM
I simply made a policy to do this. Added under "Files and Processes":
ln -s /Applications/Self\ Service.app ~/Desktop
Posted on 11-11-2022 01:10 AM
I thought Files and Processes ran as root user, but you're saying ~/Desktop still points to the currently logged in user's desktop?
11-11-2022 11:05 AM - edited 11-11-2022 11:06 AM
I made a policy real quick after reading this and it works fine... literally took a couple minutes, so try it!
Posted on 11-13-2022 02:26 PM
It didn't work for me. The logs tell me it has completed but there is no Alias on the desktop.
I think @piotrr may be correct and the command is running as root user, as the logs show this:
Executing Policy Self Service Alias
Running command ln -s /Applications/Self\ Service.app ~/Desktop...
Result of command:
ln: /var/root/Desktop/Self Service.app: File exists
Posted on 11-14-2022 08:53 AM
Well, it is working here, and based on the log entry above, there's already one on the desktop, hence it failed.
I saw the same if I re-ran it as-is, so not sure why I can use it here and you can't. I honestly thought it would not work for the reason above, but it does... ¯\_(ツ)_/¯
Either way, glad you got it sorted...👍
Posted on 11-14-2022 04:39 PM
Maybe because I'm using an AD account to login to my Mac? Not sure myself.
Like you say, at least it's sorted... and for anyone looking at this article in future, there's a couple of tried-and-tested options to try!
Thanks for the assist, I wouldn't have known where to begin otherwise.
Posted on 11-13-2022 04:47 PM
I went with this in the end: created a script and got the policy to deploy it. The script contents being:
#!/bin/sh
sudo -u $3 ln -s /Applications/Self\ Service.app /users/$3/Desktop
The key thing here being the $3 parameter, which Jamf defines as the current logged on user.
Thanks for the assistance, jamfers!