Outlook prompts for credentials with Exchange 2010 and 2013/2016 coexistence

For some time ago I stumbled upon a strange credential prompt in Outlook for an entire organization after changing the Autodiscover namespace to point to the Exchange 2016 servers.
Outlook 2010 Credential Prompt

When you search for this issue with your favorite search engine you get several hits where other administrators and users got the same error.  The solutions posted in the forums, blogs and articles were all different but they were all touching the same subject, Autodiscover.
So I decided to try the top solutions i found to see if it resolves my issue.

Our servers:
1 Exchange 2010 CAS/HUB
1 Exchange 2010 Mailbox
2 Exchange 2016 Mailbox (Mailbox role in Exchange 2016 has all Exchange roles except Edge)
Namespace URLs for both Exchange 2010 and Exchange 2016:
Outlook Anywhere: mail.contoso.com
OWA: https://mail.contoso.com/owa
ECP: https://mail.contoso.com/ecp
ActiveSync: https://mail.contoso.com/MicrosoftServerActiveSync
EWS: https://mail.contoso.com/EWS/Exchange.asmx
OAB: https://mail.contoso.com/oab
MAPI: https://mail.contoso.com/mapi
Autodiscover SCP: https://mail.contoso.com/Autodiscover/Autodiscover.xml
We are using a SRV-record for autodiscover instead of a A-record for the external DNS Zone.

Powershell 4.0 – Try/Catch Exchange 2010 Bug?

I’ve been struggling some time now on why Powershell 4.0 are unable to “Catch” terminating errors when using Exchange 2010 Cmdlets.

When using a standard “Set-Mailbox” with Erroraction set to Stop using Powershell 3.0 the terminating error is validated by the “Try/Catch”-block:

Error with Set-Mailbox

When we use Powershell 4.0 with the same “Try/Catch”-block the result will be:

The operation couldn’t be performed because object ‘NoMailbox’ couldn’t be found on ‘DC01.contoso.com’.
+ CategoryInfo          : NotSpecified: (0:Int32) [Set-Mailbox], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : 7780025A,Microsoft.Exchange.Management.RecipientTasks.SetMailbox
+ PSComputerName        : EX2010.contoso.com

A workaround for this is to use the $ErrorActionPreference variable:

Error with Set-Mailbox

Found an old thread on Technet touching this subject: Technet Forum
My speculation is whether this is a bug in the remote management of PowerShell 4.0 with Exchange 2010 Cmdlets or if it’s by design.
Either way the workaround works!

I haven’t tested this with Powershell 5.0. If you have please enlighten me if it works as it should like Powershell 3.0