We have faced this problem in our environment:

Problem :
Proxy setting change automatically for external users when they connect to LAN

Solution : Run the command

  1. Set-OutlookProvider EXPR -Server $null -CertPrincipalName none
  2. Restart Internet Information Services IIS or recycle "MSExchangeAutodiscoverAppPool" on Exchange server that runs the Client Access server role for this change to take immediate effect. To recycle MSExchangeAutodiscoverAppPool, which is the application pool for the Autodiscover service on the Exchange Client Access server, follow these steps: