I would like to create entries for the company's Wifi in every Mac via Puppet. Is this possible? (or if it is possible from the command line, I can figure out how to do it in Puppet)


2 Answers 2


You can also use profiles via CLI. This is totally unattended and if your profile requires any user input it will fail to install.

I've successfully deployed WiFi networks via Puppet using this method.

The command to install a profile is:

sudo profiles -I -F /path/to/profile.mobileconfig

Running as sudo/root will install the profile as a Device Profile and affects all users while installing as the current user will just install it as a User profile thus just affecting the User which ran the command.

Further information here


From the CLI, one can use a command such as:

$ sudo networksetup -addpreferredwirelessnetworkatindex en1 <ssid> 0 WPA2 <passphrase>

The 0 specifies the "index" where the entry will show up in the wifi networks list, with 0 being top of the list.

I have not been able to get this working in a completely hands-free way, though. Even when running via sudo, OSX Mavericks still throws a single modal dialogue box asking the user to approve adding the entry to their keychain.

  • As much as I love Apple hardware and OSX at a personal level, as a sysadmin I find constant reminders that Apple either don't understand, or are actually going out of their way to ignore, the needs of businesses and sysadmins.
    – Rob Moir
    Jun 4, 2014 at 8:44
  • 1
    @RobM - Apple's enterprise management tools (OpenDirectory / ARD / Group Policy / etc.) are actually quite good. Without that, though, one needs to resort to "hacks" like the above to accomplish things.
    – EEAA
    Jun 18, 2014 at 20:27
  • 1
    I've supported Apple in enterprise for some time. I've used Open Directory, ARD and preferences/profile manager and they've always been pretty dodgy once you start talking about a hundred or more macs in a large windows domain in my experience. By far the best tool I've found for managing macs is the Parallels SCCM plugin for the mac... but that only makes sense if you have a large enough windows deployment to make SCCM attractive for managing the windows network.
    – Rob Moir
    Jun 18, 2014 at 21:12
  • @RobM - good to know. I've never used Apple's tools in anything larger than a few dozen machines.
    – EEAA
    Jun 18, 2014 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.