Using ARD to set SSID, but users get keychain login prompt
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.