Hey was just wondering if anyone has used a script to automate VPN setup with OS X's built-in VPN client. I've tried using an Applescript but it kind of works in 10.8 and doesn't work at all in 10.9. The script is very similar to the one found here:
Wanted to see what everyone else was using (if anything at all). Thanks in advance.
There are two options that I know of...
1) a .mobileconfig file out of Casper or ProfileManager, installed either over MDM or the bash command "profiles"
2) a complex script using the bash command "networksetup"
If you script the installation of the mobileconfig in a package, than the user is provided a system-UI for password entry.
If you are setting it up at imaging time, than you can store the mobileconfig file somewhere and craft up a LaunchDaemon to install it once there is an active console user.
Either way, root is actually running the script, so password issues at that point become moot.
Hey Conor long time no talk, using Casper at the new job?
and if you put the vpn icon in the menu bar each user can add their credentials at the time of VPN connection so no need to worry about per user settings either.
@perrycj It requires there to be something in the username field, yes, but you can easily use "Enter your username" or some such.
@nessts We have Casper in limited pilot to about 1% of our users. We are hoping to go into production early next year. I can go into more detail offline if you're interested (Rick has my contact info).
But i'd really recommend a config profile & use:
In the username field to grab the username of the logged in user (well logging in user).
There is also an open source command line tool written in Objective-C which might help you: https://github.com/halo/macosvpn
It pretty much simulates using the Systems Preferences Network pane, only using the native SystemPreferences API. It's also faster than AppleScript.
I wrote this awhile ago for our corporate vpn's we didn't like the idea of storing the VPN in a script and needed the ability to provide our Infrastructure team a place to swap out shared key's them without getting their hands dirty.