ForeScout deploys but wont auto launch

New Contributor

Hey All!

So ForeScout downloads as a DMG for us which I can get to install properly on machines, but it will not auto launch.

If i install manually (a la double clicking it) it will go through the process, ask me to authenticate, then the icon will show up in the menu bar.

Yet a push only places the app in the applications folder.

I have tried doing a composer with the file change and everything, waited for the app to launch automatically and show up in the menu bar then pushing that package, but nothing helps.

Last ditch effort was to create a script that looks for the app and forces it to autolaunch, but that seems highly inefficient.

Any suggestions?



Valued Contributor

Try to add an:

open /Applications/

To the policy via "Execute Command" under the "Files And Processes" heading.

See if that does it for you.

New Contributor

rats, i was hoping it would be that easy.

the problem now is the following:

  1. the name has a space in it (ForeScout says getinfo, but if i try the command by itself it wont work (nor as an addition to the policy). -error: the files /Applications/ForeScout and /Users/(un)/ does not exist.
  2. for some reason, opening the application ALWAYS requires authentication (which i dont know how to bypass)
  3. when i authenticate and start the app, it runs as my username AND root

New Contributor

ill try the following, looks promising

open -a Forescout SecureConnector

edit: osascript still bugs for credentials, even when opening it with sudo.

New Contributor

hey @jreinstedler

you got any thoughts on this?
maybe share how you are deploying this now.

New Contributor

Hey Justin,

Did you get anywhere with this? I'm running into the same issue.

osascript still bugs for credentials?

Thanks, James

New Contributor

hey was anyone able to get this one working? I'm having the same issue.

New Contributor

Yo MacDaddy's,

open /Applications/ did not work for me. I kept banging at it to try to get it to work.

I ended up using the package I made with Composer (Can't remember if I did anything special) and used AutoDMG with the OS 10.11.dmg from Apple and added my Forescout.pkg to the .dmg from the AutoDMG build. 10.11 worked fine with imaging. 10.12 is giving me issues in AutoDMG with the Forescout pkg. but it works as a package via Self Service now. Still testing 10.12 imaging.

Hope that helps. JW

New Contributor III

I dropped the following 2 commands in to Files&Processes, which launched the SC agent and authenticated for osascript silently, after installing the pkg of ForeScout created in Composer. Hopefully I quoted out the first command properly but please doublecheck (no errors when I ran it).

Hope this helps!

sudo osascript -e "do shell script "/Library/Application\ Support/ForeScout/" with administrator privileges"

sudo launchctl load /Library/LaunchAgents/com.forescout.secureconnector.agent.plist

Contributor III


What is inside the ForeScout/ file?

New Contributor II

Hey, does anyone found a solution for that? I’m having the same issue...

New Contributor II

Hey, I found this script that fixed the issue for me, hope that will help you too:

Downloading OSX Update Package to /tmp on the host
curl -o /tmp/update.tgz http://YOUR_SERVER_NAME_OR_IP/SC_packages/update.tgz; sleep 3

Extracting update.tgz to /tmp
tar -zxvf /tmp/update.tgz -C /tmp; sleep 3

Installing SecureConnector as a Daemon/Dissolvable w/ visible/invisible menu bar icon
sudo -S /tmp/Update/ -t daemon -v 1; sleep 3

Checking/Starting processes in case they did not start on install
daemon_pid=ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-daemon" | awk '{print $2}'
agent_pid=ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-agent" | awk '{print $2}'

if [[ -z "$daemon_pid" && -z "$agent_pid" ]]; then #Starting Daemon process launchctl unload $daemon_plist launchctl load $daemon_plist

Starting GUI process launchctl unload $agent_plist launchctl load $agent_plist
elif [[ ! -z "$daemon_pid" && -z "$agent_pid" ]]; then #Starting GUI process launchctl unload $agent_plist launchctl load $agent_plist

Clean-up a little
sudo rm -rf /tmp/update.tgz /tmp/Update/