Need to open app as user via Jamf Policy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Read My Blog: https://www.ericsontech.com
Labels:
- Labels:
-
Jamf Pro
Reply
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 06-22-2021 07:04 AM
su -l ${CURRENT_USER} -c "open /Applications/Jamf Connect.app/"

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-13-2022 08:12 PM
does not like the -c option.
