Hi all,
what is the most efficient way to push proxy.pac settings via JSS?
And how can we verify which settings are in use?
We are using Sierra 10.12.3 and Jamf Pro 9.97
Thanks a lot!
Solved
Pushing Proxy PAC files via JSS - Verifying settings
Best answer by perrycj
@mteget65 .pac files are usually as apart of a URL and you can point a mac or macs to this URL to utilize the .pac file.
If you're doing it this way, you can just set the proxy pac URL in system preferences (network > advanced > proxies) via script. Here is something you can use:
#!/bin/bash
# HARDCODED VALUES ARE SET HERE
autoProxyURL=""
# CHECK TO SEE IF A VALUE WAS PASSED FOR $4, AND IF SO, ASSIGN IT
if [ "$4" != "" ] && [ "$autoProxyURL" == "" ]; then
autoProxyURL=$4
echo "[$(date)] Proxy URL is $autoProxyURL" >>"$LOGFILE"
fi
# Detects all network hardware & creates services for all installed network hardware
/usr/sbin/networksetup -detectnewhardware
IFS=$'
'
#Loops through the list of network services
for i in $(networksetup -listallnetworkservices | tail +2 );
do
# Get a list of all services
autoProxyURLLocal=`/usr/sbin/networksetup -getautoproxyurl "$i" | head -1 | cut -c 6-`
# Echo's the name of any matching services & the autoproxyURL's set
echo "$i Proxy set to $autoProxyURLLocal"
# If the value returned of $autoProxyURLLocal does not match the value of $autoProxyURL for the interface $i, change it.
if [[ $autoProxyURLLocal != $autoProxyURL ]]; then
networksetup -setautoproxyurl $i $autoProxyURL
echo "Set proxy for $i to $autoProxyURL"
fi
done
echo "Proxies All Present And Correct..."
unset IFS
You can run this from Self Service or as apart of your first run script/workflow. You can also set the .pac file URL as the $4 variable in the JSS or just hard-code it into this script. Up to you but I would just use the variable instead of hard-coding. Hopefully it helps you out.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
