Office 365 SBS2011 Outlook won’t connect or keeps changing back to local exchange – Autodiscover

On SBS Server
Command Prompt run as admin:
%windir%\system32\inetsrv\appcmd.exe add backup BeforeRemovalAutodiscover

Exchange Management Shell run as admin:
Get-AutodiscoverVirtualDirectory | fl Name, Server, InternaUrl, Identity

Remove-AutodiscoverVirtualDirectory –Identity “identity value retrieved above”

If for some reason you need to restore autodiscover on the SBS server
Command Prompt run as admin:
%windir%\system32\inetsrv\appcmd.exe restore backup BeforeRemovalAutodiscover

Source: BlogsIISNet

Source: Toronto Help Desk