none
2012 R2 Essentials experience O365 Integration suddenly failing

    Question

  • After working flawlessly for quite some time the integration seems to have failed. Now if I try to do anything with the account it tells me "Cannot Connect to Microsoft Online Services. Make sure that the computer is connected to the internet and then try again."

    The internet connection on the server is fine and I can even sign into the Office 365 webmail from the server.

    The last logs found at C:\ProgramData\Microsoft\Windows Server\Logs\SharedServiceHost-EmailProviderServiceConfig are as follows

    Server stack trace: 
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IProvisioningWebService.MsolConnect(Request request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
    [8180] 170907.133032.6265: UpdateMSOSecurityGroupDataTask: Failed to run UpdateMSOSecurityGroupDataTask: O365ConfigurationFault = Communication
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Connect to BECWS failed.
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.get_Client()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.<>c__DisplayClass70.<ListSecurityGroups>b__69(ListGroupsRequest r)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebServiceWithRetry[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebService[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.ListSecurityGroups()
       at Microsoft.WindowsServerSolutions.O365Integration.MSOSecurityGroupManager.CleanUpMSOSecurityGroupData()
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateMSOSecurityGroupDataTask.Run().
    [8180] 170907.133032.6265: UpdateMSOSecurityGroupDataTask: End UpdateMSOSecurityGroupDataTask
    [844] 170907.133033.0328: UpdateCachedSkuInfoTask: failed to connect to https://www.microsoft-sbs-domains.com/Productivity/en-US/Skus.xml within the WebException: The remote server returned an error: (400) Bad Request., status: ProtocolError
    [844] 170907.133033.0953: UpdateCachedSkuInfoTask: failed to connect to https://www.microsoft-sbs-domains.com/Productivity/Skus.xml within the WebException: The remote server returned an error: (400) Bad Request., status: ProtocolError
    [8188] 170907.133033.3921: BecWebServiceAdapter: Set Credentail failed : Microsoft.WindowsServerSolutions.O365Integration.WindowsLiveException: GetAuthInvalidState() failed on the condition [currentStatus.AuthState : -2147186688]. HResult:0.
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.GetAuthenticationStatus(String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogonPassport(String policy, String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogOnUser(String userName, String password, String siteName, String policy, String environment)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
    [8188] 170907.133033.4234: CoreNet: Sending DNS request packet to 68.94.156.1
    [8180] 170907.133033.4234: CoreNet: Sending DNS request packet to 68.94.157.1
    [844] 170907.133033.4234: CoreNet: Sending DNS request packet to 208.67.222.222
    [8188] 170907.133033.4234: CoreNet: Got answer from root server 68.94.156.1
    [8180] 170907.133033.4234: CoreNet: Got answer from root server 68.94.157.1
    [844] 170907.133033.5484: CoreNet: Got answer from root server 208.67.222.222
    [8188] 170907.133033.5484: CoreNet: Successfully connected to the Internet
    [8188] 170907.133033.5484: UpdateO365IntegrationDataTask: Failed to get all users : O365ConfigurationFault = IncorrectCredential
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Credential cannot be authenticated
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.CheckState()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.QueryAllOnlineUsersInternal(Boolean throwOnFault)
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateO365IntegrationDataTask.Run()
    [4384] 170907.133033.8609: BecWebServiceAdapter: Set Credentail failed : Microsoft.WindowsServerSolutions.O365Integration.WindowsLiveException: GetAuthInvalidState() failed on the condition [currentStatus.AuthState : -2147186688]. HResult:0.
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.GetAuthenticationStatus(String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogonPassport(String policy, String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogOnUser(String userName, String password, String siteName, String policy, String environment)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
    [4384] 170907.133033.8765: CoreNet: Sending DNS request packet to 68.94.156.1
    [2536] 170907.133033.8765: CoreNet: Sending DNS request packet to 68.94.157.1
    [8188] 170907.133033.8765: CoreNet: Sending DNS request packet to 208.67.222.222
    [2536] 170907.133033.8921: CoreNet: Got answer from root server 68.94.157.1
    [4384] 170907.133033.8921: CoreNet: Got answer from root server 68.94.156.1
    [8188] 170907.133033.8921: CoreNet: Got answer from root server 208.67.222.222
    [4384] 170907.133033.8921: CoreNet: Successfully connected to the Internet
    [4384] 170907.133033.8921: O365ClientProvider(ICallback): <GetSharePointAddress>b__0() failed due to : O365ConfigurationFault = IncorrectCredential
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Credential cannot be authenticated
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.CheckState()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ClientProvider.<GetSharePointAddress>b__0()
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderBase`1.InvokeOperationSync[T](Func`1 func, Boolean throwFault)
    [5056] 170907.133033.9078: UpdateSharepointAddressTask: Error to get sharepoint address : Microsoft.WindowsServerSolutions.Common.ProviderFramework.OperationInvokeException: InvokeAction failed with known issue : FaultException`1 ---> System.ServiceModel.FaultException`1[Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException]: The creator of this fault did not specify a Reason.

    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.WindowsServerSolutions.O365Integration.IO365ClientProvider.GetSharePointAddress()
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ObjectModelBaseExtended`1.Invoke[TResult](Func`1 func)
       --- End of inner exception stack trace ---
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ObjectModelBaseExtended`1.Invoke[TResult](Func`1 func)
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateSharepointAddressTask.Run()
    [5132] 170907.133033.9390: O365ClientProvider(ICallback): Channel_Closed called
    [5132] 170907.133033.9390: O365ClientProvider(ICallback): Provider disconnected
    [5132] 170907.133037.6265: O365ManagementProvider(IO365Callback): Channel_Closed called
    [5132] 170907.133037.6265: O365ManagementProvider(IO365Callback): Provider disconnected
    [364] 170907.133101.9389: O365Integration:BackgroundTaskManager: BackgroundTaskManager.StopTasks called
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: Stopping UpdateDomainTask
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: updating UpdateDomainTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: Stopping UpdateSharepointAddressTask
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: updating UpdateSharepointAddressTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: Stopping UpdateO365IntegrationDataTask
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: updating UpdateO365IntegrationDataTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: Stopping UpdateCachedSkuInfoTask
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: updating UpdateCachedSkuInfoTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: Stopping UpdateMSOSecurityGroupDataTask
    [364] 170907.133101.9389: O365Integration:BackgroundTaskBase: updating UpdateMSOSecurityGroupDataTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.0952: O365Integration:BackgroundTaskManager: BackgroundTaskManager.Dispose called
    [8136] 170907.133103.1733: O365Integration:BackgroundTaskBase: Stopping UpdateDomainTask
    [8136] 170907.133103.1889: O365Integration:BackgroundTaskBase: updating UpdateDomainTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.1889: O365Integration:BackgroundTaskBase: Dispose for UpdateDomainTask called
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Stopping UpdateSharepointAddressTask
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: updating UpdateSharepointAddressTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Dispose for UpdateSharepointAddressTask called
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Stopping UpdateO365IntegrationDataTask
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: updating UpdateO365IntegrationDataTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Dispose for UpdateO365IntegrationDataTask called
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Stopping UpdateCachedSkuInfoTask
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: updating UpdateCachedSkuInfoTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Dispose for UpdateCachedSkuInfoTask called
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Stopping UpdateMSOSecurityGroupDataTask
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: updating UpdateMSOSecurityGroupDataTask timer to: TimerSettings: DueTime=-00:00:00.0010000, Interval=00:00:00
    [8136] 170907.133103.2046: O365Integration:BackgroundTaskBase: Dispose for UpdateMSOSecurityGroupDataTask called
    [6452] 170907.133103.3920: MSOSecurityGroupManager: MSO Security Group Sync Worker Thread Stopped.
    [8136] 170907.133103.4077: SharedServiceHost: Information: [0] : Exiting with code 0
    [8136] 170907.133103.4077: SharedServiceHost: Information: [0] : ==========================================================


    • Edited by Eric Elkmann Thursday, September 07, 2017 7:33 PM
    Thursday, September 07, 2017 7:32 PM

Answers

  • I have resolved a similar issue in which the we were not able to enable O365 integration wizard. Logs had similar entries like:

    -------

    [16588] 170910.234323.4138: BecWebServiceAdapter: Connect to BECWS failed due to known exception : System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://bws902-relay.microsoftonline.com/ProvisioningWebservice.svc?Redir=-729933127&Time=636356536485633647 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 157.56.55.77:443

    --------

    Resolution was:

    Check registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\Productivity\O365Integration\Settings

    If that URL is listed under there - remove the subkey and try to run the integration wizard again

    Make sure to take the backup of the registry key.

    • Marked as answer by Eric Elkmann Thursday, September 14, 2017 4:33 PM
    Monday, September 11, 2017 10:08 AM

All replies

  • Was this server migrated from any other server? If so check

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\ADContext]
    "ConnectedDc"="server.domain.local"

    and make sure it points to the correct server


    Mariëtte Knap
    www.server-essentials.com | Migrations done the easy way, migrate from SBS 2003, 2008 or 2011 to Windows Server 2016 and Office 365

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Friday, September 08, 2017 12:43 AM
  • Hi,

    Please try to install the latest monthly update rollup for Windows Server 2012 R2, then, restart the system and check the result.

    August 8, 2017—KB4034681 (Monthly Rollup):
    https://support.microsoft.com/en-us/help/4034681

    KB4034681 download link:
    http://www.catalog.update.microsoft.com/Search.aspx?q=KB4034681

    Best Regards,
    Eve Wang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, September 08, 2017 7:30 AM
    Moderator
  • Mariëtte,

    This server has never been migrated. It was build from scratch as 2012 R2 and has been a DC and essentials experience box ever since.

    I checked the key you mentioned anyway and it seems to point to itself which as I understand it is what it should be doing.

    Eve,

    I have verified that the KB you linked has been installed and the server rebooted. it has had no effect on the connection.

    The latest from the logs is below


    Server stack trace: 
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IProvisioningWebService.MsolConnect(Request request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskManager: BackgroundTaskManager.StartTasks called
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: Starting UpdateDomainTask
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: updating UpdateDomainTask timer to: TimerSettings: DueTime=00:00:00, Interval=01:00:00
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: Starting UpdateSharepointAddressTask
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: updating UpdateSharepointAddressTask timer to: TimerSettings: DueTime=00:00:00, Interval=1.00:00:00
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: Starting UpdateO365IntegrationDataTask
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: updating UpdateO365IntegrationDataTask timer to: TimerSettings: DueTime=00:00:00, Interval=01:00:00
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: Starting UpdateCachedSkuInfoTask
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: updating UpdateCachedSkuInfoTask timer to: TimerSettings: DueTime=00:00:00, Interval=1.00:00:00
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: Starting UpdateMSOSecurityGroupDataTask
    [1808] 170908.085956.7601: O365Integration:BackgroundTaskBase: updating UpdateMSOSecurityGroupDataTask timer to: TimerSettings: DueTime=00:00:00, Interval=1.00:00:00
    [1808] 170908.085956.7601: O365ManagementProvider(IO365Callback): ActivateAAD:b93656c1-87f5-433e-9b80-8887ea21b50b failed due to O365ConfigurationFault = Communication
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Connect to BECWS failed.
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.get_Client()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.<ListUsers>b__18(ListUsersRequest r)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebServiceWithRetry[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebService[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.ListUsers()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.verifyAdminAccount(IO365ServiceAdapter adapter, String adminUserName, SecureString adminPassword)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.ActivateAAD(String adminUserName, String adminPassword)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementProvider.<>c__DisplayClassd9.<InvokeOperationWrapperAsync>b__d8()
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderBase`1.InvokeOperation[TResult](String operationName, Func`1 func)
    [7712] 170908.085957.1195: BecWebServiceAdapter: Set Credentail failed : Microsoft.WindowsServerSolutions.O365Integration.WindowsLiveException: GetAuthInvalidState() failed on the condition [currentStatus.AuthState : -2147186688]. HResult:0.
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.GetAuthenticationStatus(String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogonPassport(String policy, String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogOnUser(String userName, String password, String siteName, String policy, String environment)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
    [7712] 170908.085957.1351: CoreNet: Checking installed DNS server for configured forwarders or root hints
    [7712] 170908.085957.2445: CoreNet: Using 3 configured forwarders or root hints.
    [7712] 170908.085957.2757: CoreNet: Sending DNS request packet to 68.94.156.1
    [7712] 170908.085957.2914: CoreNet: Got answer from root server 68.94.156.1
    [7712] 170908.085957.2914: CoreNet: Successfully connected to the Internet
    [7712] 170908.085957.2914: UpdateDomainTask: Error in updating domain : O365ConfigurationFault = IncorrectCredential
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Credential cannot be authenticated
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.CheckState()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.UpdateCustomDomain()
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateDomainTask.Run()
    [5084] 170908.085957.4164: UpdateCachedSkuInfoTask: failed to connect to https://www.microsoft-sbs-domains.com/Productivity/en-US/Skus.xml within the WebException: The remote server returned an error: (400) Bad Request., status: ProtocolError
    [5084] 170908.085957.4789: UpdateCachedSkuInfoTask: failed to connect to https://www.microsoft-sbs-domains.com/Productivity/Skus.xml within the WebException: The remote server returned an error: (400) Bad Request., status: ProtocolError
    [6248] 170908.085957.4789: UpdateMSOSecurityGroupDataTask: Start UpdateMSOSecurityGroupDataTask
    [6248] 170908.085957.4789: MSOSecurityGroupManager: Full sync task will start in 00:10:00 minutes.
    [6248] 170908.085958.8070: BecWebServiceAdapter: Connect to BECWS failed due to known exception : System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://bws902-relay.microsoftonline.com/ProvisioningWebservice.svc?Redir=-648931149&Time=636356549805442141 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 157.56.55.77:443
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
       --- End of inner exception stack trace ---
       at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
       at System.Net.HttpWebRequest.GetRequestStream()
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       --- End of inner exception stack trace ---

    Server stack trace: 
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IProvisioningWebService.MsolConnect(Request request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
    [6248] 170908.085958.8070: UpdateMSOSecurityGroupDataTask: Failed to run UpdateMSOSecurityGroupDataTask: O365ConfigurationFault = Communication
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Connect to BECWS failed.
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.Connect()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.get_Client()
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.<>c__DisplayClass70.<ListSecurityGroups>b__69(ListGroupsRequest r)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebServiceWithRetry[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.InvokeWebService[TRequest,TResponse](Func`2 func, TRequest request)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.ListSecurityGroups()
       at Microsoft.WindowsServerSolutions.O365Integration.MSOSecurityGroupManager.CleanUpMSOSecurityGroupData()
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateMSOSecurityGroupDataTask.Run().
    [6248] 170908.085958.8070: UpdateMSOSecurityGroupDataTask: End UpdateMSOSecurityGroupDataTask
    [7808] 170908.085959.1039: BecWebServiceAdapter: Set Credentail failed : Microsoft.WindowsServerSolutions.O365Integration.WindowsLiveException: GetAuthInvalidState() failed on the condition [currentStatus.AuthState : -2147186688]. HResult:0.
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.GetAuthenticationStatus(String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogonPassport(String policy, String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogOnUser(String userName, String password, String siteName, String policy, String environment)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
    [7808] 170908.085959.1351: CoreNet: Sending DNS request packet to 68.94.156.1
    [6248] 170908.085959.1351: CoreNet: Sending DNS request packet to 68.94.157.1
    [5084] 170908.085959.1351: CoreNet: Sending DNS request packet to 208.67.222.222
    [6248] 170908.085959.1351: CoreNet: Got answer from root server 68.94.157.1
    [7808] 170908.085959.1351: CoreNet: Got answer from root server 68.94.156.1
    [5084] 170908.085959.1507: CoreNet: Got answer from root server 208.67.222.222
    [7808] 170908.085959.1507: CoreNet: Successfully connected to the Internet
    [7808] 170908.085959.1507: UpdateO365IntegrationDataTask: Failed to get all users : O365ConfigurationFault = IncorrectCredential
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Credential cannot be authenticated
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.CheckState()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.QueryAllOnlineUsersInternal(Boolean throwOnFault)
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateO365IntegrationDataTask.Run()
    [6548] 170908.085959.4632: BecWebServiceAdapter: Set Credentail failed : Microsoft.WindowsServerSolutions.O365Integration.WindowsLiveException: GetAuthInvalidState() failed on the condition [currentStatus.AuthState : -2147186688]. HResult:0.
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.GetAuthenticationStatus(String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogonPassport(String policy, String siteName)
       at Microsoft.WindowsServerSolutions.O365Integration.LiveIdentityManager.LogOnUser(String userName, String password, String siteName, String policy, String environment)
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
    [6248] 170908.085959.4789: CoreNet: Sending DNS request packet to 68.94.157.1
    [5084] 170908.085959.4789: CoreNet: Sending DNS request packet to 208.67.222.222
    [6548] 170908.085959.4789: CoreNet: Sending DNS request packet to 68.94.156.1
    [6248] 170908.085959.4945: CoreNet: Got answer from root server 68.94.157.1
    [6548] 170908.085959.4945: CoreNet: Got answer from root server 68.94.156.1
    [5084] 170908.085959.5258: CoreNet: Got answer from root server 208.67.222.222
    [6548] 170908.085959.5258: CoreNet: Successfully connected to the Internet
    [6548] 170908.085959.5258: O365ClientProvider(ICallback): <GetSharePointAddress>b__0() failed due to : O365ConfigurationFault = IncorrectCredential
    Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException: Credential cannot be authenticated
       at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.SetCredential(String userName, SecureString password)
       at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.CheckState()
       at Microsoft.WindowsServerSolutions.O365Integration.O365ClientProvider.<GetSharePointAddress>b__0()
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderBase`1.InvokeOperationSync[T](Func`1 func, Boolean throwFault)
    [7712] 170908.085959.5570: UpdateSharepointAddressTask: Error to get sharepoint address : Microsoft.WindowsServerSolutions.Common.ProviderFramework.OperationInvokeException: InvokeAction failed with known issue : FaultException`1 ---> System.ServiceModel.FaultException`1[Microsoft.WindowsServerSolutions.O365Integration.O365ConfigureException]: The creator of this fault did not specify a Reason.

    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.WindowsServerSolutions.O365Integration.IO365ClientProvider.GetSharePointAddress()
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ObjectModelBaseExtended`1.Invoke[TResult](Func`1 func)
       --- End of inner exception stack trace ---
       at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ObjectModelBaseExtended`1.Invoke[TResult](Func`1 func)
       at Microsoft.WindowsServerSolutions.O365Integration.UpdateSharepointAddressTask.Run()
    [1808] 170908.085959.6039: O365ClientProvider(ICallback): Channel_Closed called
    [1808] 170908.085959.6039: O365ClientProvider(ICallback): Provider disconnected
    [1808] 170908.090000.0257: O365ManagementProvider(IO365Callback): Channel_Closed called
    [1808] 170908.090000.0257: O365ManagementProvider(IO365Callback): Provider disconnected
    [7548] 170908.090053.5827: DomainInformationHelpers: DsBind with domain controller GHA.GHAVIATION.local return code: 0

    Friday, September 08, 2017 2:02 PM
  • I have resolved a similar issue in which the we were not able to enable O365 integration wizard. Logs had similar entries like:

    -------

    [16588] 170910.234323.4138: BecWebServiceAdapter: Connect to BECWS failed due to known exception : System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://bws902-relay.microsoftonline.com/ProvisioningWebservice.svc?Redir=-729933127&Time=636356536485633647 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 157.56.55.77:443

    --------

    Resolution was:

    Check registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\Productivity\O365Integration\Settings

    If that URL is listed under there - remove the subkey and try to run the integration wizard again

    Make sure to take the backup of the registry key.

    • Marked as answer by Eric Elkmann Thursday, September 14, 2017 4:33 PM
    Monday, September 11, 2017 10:08 AM
  • Mahesh,

    Thank you!! Removing that key enabled me to successfully run the integration again. I haven't  set everything back up again yet but it is looking up!

    Thursday, September 14, 2017 4:33 PM
  • Excellent, This solved my issue, you are the best technician.
    Tuesday, March 20, 2018 1:10 PM