Hello All -
I'm trying to update my wireless SSID pwd using the following commands, however it's prompting for the administrator username and pwd to make changes to the system keychain. I want to make it seamless so the user will not have to enter anything.
Is there a way to pass the admin's creds and select Allow to make this update change using some kind of commands (applescript, bash, etc)?
Thanks very much.
Here's my script:
sudo networksetup -setairportpower en0 off
sudo networksetup -removepreferredwirelessnetwork en0 Network_Name
sudo networksetup -setairportpower en0 on
sudo networksetup -setairportnetwork en0 Network_Name NetworkPWD
Network_Name = name of my SSID
NetworkPWD = pwd of the SSID
I'm trying to update my wireless SSID pwd using the following commands, however it's prompting for the administrator username and pwd to make changes to the system keychain. I want to make it seamless so the user will not have to enter anything.
Is there a way to pass the admin's creds and select Allow to make this update change using some kind of commands (applescript, bash, etc)?

Thanks very much.
Here's my script:
sudo networksetup -setairportpower en0 off
sudo networksetup -removepreferredwirelessnetwork en0 Network_Name
sudo networksetup -setairportpower en0 on
sudo networksetup -setairportnetwork en0 Network_Name NetworkPWD
Network_Name = name of my SSID
NetworkPWD = pwd of the SSID