This error is observed in the ENS logs when using either a Saas or an On Premise instance of AirWatch.
The detailed error is as below
AW.Mail.Notification.Service.BusinessImpl.ExchangeSubscriber Unable to open Exchange Connection Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
It could be because of the following:
- The ENS server cannot communicate with the exchange/office 365 EWS endpoint because of a network or SSL Issue.
- The office 365/Exchange EWS endpoint is not configured to accept connections.
To resolve the above error perform the following.
1. Check if port 443 is open from the ENS Server to the Exchange Server.
2. Check and resolve the SSL error from the ENS Server to the Exchange Server.
3. If the end point is office 365. Run the queries below to allow all client apps access to REST/EWS.
Set-OrganizationConfig -EwsApplicationAccessPolicy EnforceBlockList -EwsBlockList $null
This sets the EWS access policy.
Get-OrganizationConfig | Format-List EwsApplicationAccessPolicy,Ews*List
This checks the access policy.
If the set command was not run you should receive the output below.
If the Set command was run successfully, you should receive the output below.