Get-MapiVirtualDirectory | Set-MapiVirtualDirectory -InternalUrl https://exchangehostname/mapi -ExternalUrl https://exchangehostname/mapi -IISAuthenticationMethods Negotiate,NTLM,Basic
Set-OrganizationConfig -MapiHttpEnabled $true
Get-MapiVirtualDirectory | Set-MapiVirtualDirectory -InternalUrl https://exchangehostname/mapi -ExternalUrl https://exchangehostname/mapi -IISAuthenticationMethods Negotiate,NTLM,Basic
Set-OrganizationConfig -MapiHttpEnabled $true