@JAMFNoob That command relies on being run as the logged in suer, and if you're running it via a script or a files & process command in a Jamf Pro policy that doesn't run as the logged in user. To see how to run a command as the logged in user take a look at the following blog post: https://scriptingosx.com/2020/08/running-a-command-as-another-user/
Could you try this?
#!/bin/bash
currentuser=$(/usr/bin/who | awk '/console/{ print $1 }')
/usr/bin/osascript > /dev/null << EOT
tell application "Finder"
activate
mount volume "smb://server/staffhome$/${currentuser}/"
end tell
EOT
Could you try this?
#!/bin/bash
currentuser=$(/usr/bin/who | awk '/console/{ print $1 }')
/usr/bin/osascript > /dev/null << EOT
tell application "Finder"
activate
mount volume "smb://server/staffhome$/${currentuser}/"
end tell
EOT
This didn't work for me - although I did try the below but still failing to get to the user's folder, just takes me to the staff directory above it
currentUser=$( echo "show State:/ Users/ConsoleUser" | scutil | awk '/ Name
{ print $3 }' )
open "smb://server/staffhome$/$currentUser"
Your script isn't running in the user context, when jamf executes it, it's run as root.
sudo -u $currentUser open "smb://server/staffhome$/$currentUser"
Might work...