Issue

During Stage 2, On-Prem Exchange may reject connection, resulting in the above error message.

Solution

The machine is missing free ports; once an administrator increases the value within the registry, the issue should be resolved. Click here for more information. You can view the full error from on-prem exchange below.

The request failed. Unable to connect to the remote server
   at QUADROtech.ExchangeWebServices.Connection.EWSExecutor.CallService(Action`3 actionToExecute, ISmtpAddressInfo smtpAddressInfo, Object state)
   at QUADROtech.ExchangeWebServices.Connection.EWSExecutor.CallService(Action`2 actionToExecute, ISmtpAddressInfo smtpAddressInfo, Object state)
   at QUADROtech.ExchangeWebServices.Folders.FolderEnumerator.GetSubfolders(FolderId folderId, Object state)
   at QUADROtech.ExchangeWebServices.Search.SearchExecutor.GetAllSubfolders(IFolderEnumerator enumerator, FolderPathInfo folderInfo, List`1 result)
   at QUADROtech.ExchangeWebServices.Search.SearchExecutor.GetAllSubfolders(IFolderEnumerator enumerator, FolderPathInfo folderInfo, List`1 result)
   at QUADROtech.ExchangeWebServices.Search.SearchExecutor.GetAllSubfolders(IFolderEnumerator enumerator, FolderPathInfo folderInfo, List`1 result)
   at QUADROtech.ExchangeWebServices.Search.SearchExecutor.SearchCollectionResult(ISearchContainer container, IEnumerable`1 filterBuilders, IFolderEnumerator folderEnumerator, IFolderHandler`1 folderHandler)
Microsoft.Exchange.WebServices.Data.IEwsHttpWebResponse GetEwsHttpWebResponse(Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest)
The request failed. Unable to connect to the remote server
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalFindFolders(IEnumerable`1 parentFolderIds, SearchFilter searchFilter, FolderView view, ServiceErrorHandling errorHandlingMode)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.FindFolders(FolderId parentFolderId, FolderView view)
   at QUADROtech.ExchangeWebServices.Folders.FolderEnumerator.<>c__DisplayClass5_1.<GetSubfolders>b__1()
   at QUADROtech.ExchangeWebServices.Folders.FolderOperationsBase.RetryFunction[T](Func`1 func, Int32 retryCount)
   at QUADROtech.ExchangeWebServices.Folders.FolderEnumerator.<>c__DisplayClass5_0.<GetSubfolders>b__0(ExchangeService service, Object innerState)
   at QUADROtech.ExchangeWebServices.Connection.EWSExecutor.<>c__DisplayClass23_0.<CallService>b__0(ExchangeService service, ICallServiceInfo credentials, Object s)
   at QUADROtech.ExchangeWebServices.Connection.EWSExecutor.CallService(Action`3 actionToExecute, ISmtpAddressInfo smtpAddressInfo, Object state)
System.Net.WebResponse GetResponse()
Unable to connect to the remote server
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
Void InternalEndConnect(System.IAsyncResult)
Only one usage of each socket address (protocol/network address/port) is normally permitted 10.10.50.224:443
   at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
Print Friendly, PDF & Email