Using ARD to set SSID, but users get keychain login prompt

terminal

I am trying to "blast" out the credentials for our next enterprise wireless SSID to all of our users using unix commands via Apple Remote Desktop. I did this flawlessly several years ago when I created the current netork/SSID. When the process gets to this command"networksetup -addpreferredwirelessnetworkatindex en0 [SSID] 0 WPA2 [Passphrase]", a popup reading, "network setup wants to use the 'login' keychain. Please enter the keychain password."

I am running the command as root and the network is added no matter what, but how can I eliminate that popup from appearing so as to not get 200 support calls/tickets?

Clients are 11" Airs running 10.10, 10.11, 10.12.

Best Answer

The easiest way to add a WiFi network with authentication to a number of Macs is to use a profile.

You can build the profile with Apple Configurator 2, copy it onto the Mac and then install it using the profiles command. So long as you are not targeting macOS 10.13 it is quite easy. For 10.13 it gets harder.