The script attached is called as part of another proxy script. When this runs first time, Auto Detect is ticked, but proxy enabled isn't. When the logon script is re-run both the auto detect is ticked and the proxy enable is ticked.