Author Topic: Lync starting with proxy  (Read 1032 times)

0 Members and 1 Guest are viewing this topic.

Offline cdms

  • Full Member
  • ***
  • Posts: 111
  • Karma: 6
  • Gender: Male
Lync starting with proxy
« on: March 05, 2013, 03:28:56 AM »
Don't know if anyone else is having issues with Microsoft Lync. It will not connect if you have a passworded proxy server enabled. Solution is to switch off the proxies, connect and then switch them on again.
After much messing and false starts I have come up with this. Please feel free to use and suggest improvements.
This works on 10.5.8, I believe AirPort may be called something different on later versions.

Code: [Select]
set theNetworkList to do shell script "networksetup -listallnetworkservices"
set theNetworkInfo to do shell script "system_profiler SPNetworkDataType"
set ATID to AppleScript's text item delimiters
set airPort to false
set builtIn to false

if "AirPort" is in theNetworkList then
set AppleScript's text item delimiters to "AirPort"
try
set theDetail to text item 2 of theNetworkInfo
set AppleScript's text item delimiters to "HTTP Proxy Enabled: "
if character 1 of text item 2 of theDetail is equal to "Y" then
do shell script "networksetup -setwebproxystate AirPort off"
set airPort to true
end if
end try
end if

if "Built-in Ethernet" is in theNetworkList then
set AppleScript's text item delimiters to "Built-in"
try
set theDetail to text item 2 of theNetworkInfo
set AppleScript's text item delimiters to "HTTP Proxy Enabled: "
if character 1 of text item 2 of theDetail is equal to "Y" then
set builtIn to true
do shell script "networksetup -setwebproxystate 'Built-in Ethernet' off"
end if
end try
end if

set AppleScript's text item delimiters to ATID

tell application "Microsoft Lync"
activate
end tell

delay 10

if airPort then
do shell script "networksetup -setwebproxystate AirPort on"
end if

if builtIn then
do shell script "networksetup -setwebproxystate 'Built-in Ethernet' on"
end if