Posted on 06-14-2017 05:07 AM
Script is being used to force a mail server address into the current Outlook account. Clients do not have admin rights and the script needs to be run under the logged in user. The markup below works great from within terminal while on the clients machine. However I'd like to have the script available within Casper Remote. I've looked through most of the threads that relate to 'executed by logged in user' without success. Thanks.
osascript -e "tell applications "Microsoft Outlook" to set server of exchange account 1 to "https://xxxSERVERxxxADDRESSxxHERE""
Solved! Go to Solution.
Posted on 06-14-2017 07:59 AM
Same idea as above, but I have a couple scripts that use the following logic:
#!/bin/sh
#Define logged in user
user=`ls -la /dev/console | cut -d " " -f 4`
#Run command with sudo as user
sudo -u $user COMMAND
Posted on 06-14-2017 06:55 AM
Ive had to run a few scripts as the user instead of root and I needed to prefix the command with "sudo -u $3"
Posted on 06-14-2017 07:59 AM
Same idea as above, but I have a couple scripts that use the following logic:
#!/bin/sh
#Define logged in user
user=`ls -la /dev/console | cut -d " " -f 4`
#Run command with sudo as user
sudo -u $user COMMAND
Posted on 06-14-2017 09:09 AM
Thanks to you both for the help. I ended up using Kendall's markup, which worked perfectly.. Will be useful for anything going forward that requires the logged in user to be the executor.