Populating the Proxy Fields

msample
Contributor II

Having a little trouble populating the proxy fields under 10.9. When I check the script, everything looks ok but I'm not sure:

networksetup -setautomaticproxyconfiguration http://xxxx-pac.company.com:81/company-proxy.pac

I'd like for this to auto-populate, I've also created a policy for it. Thoughts?

1 ACCEPTED SOLUTION

obi-k
Valued Contributor III

I used the link below from MacMule. Saved us.

https://macmule.com/2014/12/07/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/

View solution in original post

9 REPLIES 9

htse
Contributor III

the syntax is networksetup -setautoproxyurl networkservice url

so you'll need to correct the flag and specify a networkservice or adapter

networksetup -setautoproxyurl Ethernet http://xxxx-pac.company.com:81/company-proxy.pac

obi-k
Valued Contributor III

I used the link below from MacMule. Saved us.

https://macmule.com/2014/12/07/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/

msample
Contributor II

Got it, thanks htse. I'll test it with both Wi-Fi and Thunderbolt Ethernet fields. I believe Thunderbolt should look like this:

networksetup -setautoproxyurl Thunderbolt-Ethernet http://xxxx-pac.company.com:81/company-proxy.pac

msample
Contributor II

Very nice, mvu. This works like a charm...Thanks, this is a life saver!

The only thing that needs to be inserted into the script is the URL address.

bentoms
Release Candidate Programs Tester

@mvu & @msample, glad it helps!

guidotti
Contributor II

One thing to point out is that you need to have the interfaces already created.
For instance, when you are getting MacBooks that will later be plugged into a Thunderbolt Display, you won't have that "Display Ethernet" interface yet. What I do is just plug them into a common one in my lab and then run the script.
You could run it later when they get to their final destination upon install, also. Thanks to @bentoms for the original code!

bentoms
Release Candidate Programs Tester

@guidotti, no problem & great point.

We used to run it once a day & have it triggerable via self service too.

guidotti
Contributor II

Yes, I find myself using Self-Service for a lot of things nowadays!

msample
Contributor II

@mvu I've recently been testing with the JAMF script created for web proxy under 10.10, but it has not been auto populating the web proxy field. It works well under 10.9.

Anyone seeing similar results?