Posted on 06-22-2021 06:23 AM
I have tried this script but doesn't seem to work.
#!/bin/zsh
# Get the logged in user's name
CURRENT_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/&&!/loginwindow/{print $3}')
# Get the logged in user's id
USER_ID=$(id -un $CURRENT_USER)
# Open app as user
sudo -u $USER_ID open -a 'Jamf Connect.app'
exit 0
Posted on 06-22-2021 07:04 AM
su -l ${CURRENT_USER} -c "open /Applications/Jamf Connect.app/"
Posted on 05-13-2022 08:12 PM
does not like the -c option.