Launch App as User

Cayde-6
Valued Contributor

If i simply run open -a "Microsoft Teams" through Jamf I guess Teams will open with root permissions?

How can I launch the app as the loggedinuser?

4 REPLIES 4

mm2270
Legendary Contributor II

Hi. So, this has been covered probably dozens of times on the Jamf forums. Have you done any searches using a similar term to see what comes up? I'm willing to bet you will find a thread that will help you out.
I'm happy to post some code here if you really need it, but it feels redundant to do so since I know it's been covered a lot on here.

Cayde-6
Valued Contributor

I always perform a search before I post. I typically search google, then Jamf Nation before posting

IN this case my search terms were Launch App as User for Jamf Nation

mm2270
Legendary Contributor II

This is an older thread, but might still be helpful.
https://www.jamf.com/jamf-nation/discussions/12424/open-application-via-ss

If the commands listed in there don't work, post back. There is a more updated and reliable method of running a command, launching an app or other things, as the current user from a Jamf run policy.

As an aside, I feel like Jamf really needs to think seriously about adding this basic capability in to their framework, a la this Feature Request. We've all been using workarounds for years now to get this to happen. It would be so helpful if Jamf included some easy checkbox way to say "do this policy or thing as the user logged in, not as root"

gerryf
New Contributor

I've scoured the forums on Jamf Nation and not found anything relevant.

I've also tried every possible solution from the forums.

The previous "solutions" date back to 2012 or older, and don't seem to work in newer versions of macOS. Any other ideas? It seems at least the premise is still accurate: we want to script opening an app as the currently logged in user.