none
SfB Partner Application with Exchange 2016 RRS feed

  • Question

  • Hi everyone

    I have made partner application like described in this article:

    But the test command (Test-CsExStorageConnectivity -SipUri "sip:MailAddress" -Verbose) isn't successfull and gives me a long error:

    Test-CsExStorageConnectivity : ExCreateItem exchange operation failed, code=50043,
    reason=#CTX#{ctx:{traceId:18446744071711233145, activityId:"d4405686-fba4-4215-8ec2-a776732ff9ea"}}#CTX#Could not get
    the required ExchangeServiceBinding client
    2017.06.29 14:12:37.986 Autodiscover, send GetUserSettings request, SMTP=user@domain.com, Autodiscover
    Uri=https://autodiscover.domain.com/autodiscover/autodiscover.svc, Web Proxy=<NULL>
    2017.06.29 14:12:37.986 Autodiscover.EWSMA trace, type=AutodiscoverRequestHttpHeaders, message=<Trace
    Tag="AutodiscoverRequestHttpHeaders" Tid="88" Time="2017-06-29 14:12:37Z">
    POST /autodiscover/autodiscover.svc HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/15.00.1005.003
    </Trace>
    2017.06.29 14:12:37.990 Autodiscover.EWSMA trace, type=AutodiscoverRequest, message=<Trace Tag="AutodiscoverRequest"
    Tid="88" Time="2017-06-29 14:12:37Z" Version="15.00.1005.003">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover"
    xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <a:RequestedServerVersion>Exchange2013</a:RequestedServerVersion>
          <wsa:Action>http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings</wsa:Action>
          <wsa:To>https://autodiscover.domain.com/autodiscover/autodiscover.svc</wsa:To>
        </soap:Header>
        <soap:Body>
          <a:GetUserSettingsRequestMessage xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover">
            <a:Request>
              <a:Users>
                <a:User>
                  <a:Mailbox>user@domain.com</a:Mailbox>
                </a:User>
              </a:Users>
              <a:RequestedSettings>
                <a:Setting>InternalEwsUrl</a:Setting>
                <a:Setting>ExternalEwsUrl</a:Setting>
                <a:Setting>ExternalEwsVersion</a:Setting>
              </a:RequestedSettings>
            </a:Request>
          </a:GetUserSettingsRequestMessage>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    2017.06.29 14:12:38.008 Autodiscover.EWSMA trace, type=AutodiscoverResponseHttpHeaders, message=<Trace
    Tag="AutodiscoverResponseHttpHeaders" Tid="88" Time="2017-06-29 14:12:38Z">
    HTTP/1.1 401 Unauthorized
    request-id: bd20f737-4006-4fd0-aa3b-812c9356243b
    x-ms-diagnostics: 2000003;reason="The hostname component of the audience claim value
    'https://autodiscover.domain.com' is invalid";error_category="invalid_resource"
    Server: Microsoft-IIS/8.5
    WWW-Authenticate: Bearer client_id="00000002-0000-0ff1-ce00-000000000000",
    trusted_issuers="00000004-0000-0ff1-ce00-000000000000@domain.com", token_types="app_asserted_user_v1
    service_asserted_app_v1", error="invalid_token",NTLM,Negotiate,Basic realm="autodiscover.domain.com"
    X-Powered-By: ASP.NET
    X-FEServer: serverEXC01
    Date: Thu, 29 Jun 2017 14:12:37 GMT
    Content-Length: 0
    </Trace>
    2017.06.29 14:12:38.008 Autodiscover, received GetUserSettings response, duration Ms=22, response=<NULL>
    , exception=System.ServiceModel.FaultException: #CTX#{ctx:{traceId:18446744071711233145,
    activityId:"d4405686-fba4-4215-8ec2-a776732ff9ea"}}#CTX#Could not get the required ExchangeServiceBinding client
    2017.06.29 14:12:37.986 Autodiscover, send GetUserSettings request, SMTP=user@domain.com, Autodiscover
    Uri=https://autodiscover.domain.com/autodiscover/autodiscover.svc, Web Proxy=<NULL>
    2017.06.29 14:12:37.986 Autodiscover.EWSMA trace, type=AutodiscoverRequestHttpHeaders, message=<Trace
    Tag="AutodiscoverRequestHttpHeaders" Tid="88" Time="2017-06-29 14:12:37Z">
    POST /autodiscover/autodiscover.svc HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/15.00.1005.003
    </Trace>
    2017.06.29 14:12:37.990 Autodiscover.EWSMA trace, type=AutodiscoverRequest, message=<Trace Tag="AutodiscoverRequest"
    Tid="88" Time="2017-06-29 14:12:37Z" Version="15.00.1005.003">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover"
    xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <a:RequestedServerVersion>Exchange2013</a:RequestedServerVersion>
          <wsa:Action>http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings</wsa:Action>
          <wsa:To>https://autodiscover.domain.com/autodiscover/autodiscover.svc</wsa:To>
        </soap:Header>
        <soap:Body>
          <a:GetUserSettingsRequestMessage xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover">
            <a:Request>
              <a:Users>
                <a:User>
                  <a:Mailbox>user@domain.com</a:Mailbox>
                </a:User>
              </a:Users>
              <a:RequestedSettings>
                <a:Setting>InternalEwsUrl</a:Setting>
                <a:Setting>ExternalEwsUrl</a:Setting>
                <a:Setting>ExternalEwsVersion</a:Setting>
              </a:RequestedSettings>
            </a:Request>
          </a:GetUserSettingsRequestMessage>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    2017.06.29 14:12:38.008 Autodiscover.EWSMA trace, type=AutodiscoverResponseHttpHeaders, message=<Trace
    Tag="AutodiscoverResponseHttpHeaders" Tid="88" Time="2017-06-29 14:12:38Z">
    HTTP/1.1 401 Unauthorized
    request-id: bd20f737-4006-4fd0-aa3b-812c9356243b
    x-ms-diagnostics: 2000003;reason="The hostname component of the audience claim value
    'https://autodiscover.domain.com' is invalid";error_category="invalid_resource"
    Server: Microsoft-IIS/8.5
    WWW-Authenticate: Bearer client_id="00000002-0000-0ff1-ce00-000000000000",
    trusted_issuers="00000004-0000-0ff1-ce00-000000000000@domain.com", token_types="app_asserted_user_v1
    service_asserted_app_v1", error="invalid_token",NTLM,Negotiate,Basic realm="autodiscover.domain.com"
    X-Powered-By: ASP.NET
    X-FEServer: serverEXC01
    Date: Thu, 29 Jun 2017 14:12:37 GMT
    Content-Length: 0
    </Trace>
    2017.06.29 14:12:38.008 Autodiscover, received GetUserSettings response, duration Ms=22, response=<NULL>
    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(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.Rtc.Internal.Storage.IStorageService.EndExecuteCommand(IAsyncResult asyncResult)
       at Microsoft.Rtc.Management.Lyss.Cmdlets.LyssCmdletCommon.ExecuteExCommand(StoreOperation operation, String sipUri,
    BaseRequestType ewsRequest, Nullable`1 autoCreateParentFolder, IStorageService& client, Boolean reAuthorize), inner
    exception=. Please check event log and trace for relevant information.
    At line:1 char:1
    + Test-CsExStorageConnectivity -SipUri "sip:user@domain.com" -verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Test-CsExStorageConnectivity], FaultException
        + FullyQualifiedErrorId : ErrorExecuteExchangeCommandFailedWithFaultException,Microsoft.Rtc.Management.Lyss.Cmdlet
       s.TestExStorageConnectivityCmdlet

    VERBOSE: Is command successful: False.
    Test failed.

    -----------------------------------------------------------------

    The following command is also strange I think:

    PS C:\Install> Get-CsPartnerApplication


    Identity                            : Exchange
    AuthToken                        : Value=https://autodiscover.domain.com/autodiscover/metadata/json/1
    Name                                : Exchange
    ApplicationIdentifier          : 00000002-0000-0ff1-ce00-000000000000
    Realm                               : domain.local
    ApplicationTrustLevel         : Full
    AcceptSecurityIdentifierInformation : False
    Enabled                             : True

    --------------------------------------------------------------------

    Why the realm is domain.local? I think it should be domain.com. From where it takes this realm?

    At this command th realm is correct:

    PS C:\Install> Get-CsOAuthConfiguration

    Identity                               : Global
    PartnerApplications              : {Name=Exchange;ApplicationIdentifier=00000002-0000-0ff1-ce00-000000000000;Real
                                             m=domain.local;ApplicationTrustLevel=Full;AcceptSecurityIdentifierInformation
                                             =False;Enabled=True}
    OAuthServers                           : {}
    Realm                                  : domain.com
    ServiceName                            : 00000004-0000-0ff1-ce00-000000000000
    ClientAuthorizationOAuthServerIdentity :
    ExchangeAutodiscoverUrl                : https://autodiscover.domain.com/autodiscover/autodiscover.svc
    ExchangeAutodiscoverAllowedDomains     :

    ---------------------------------------------------------------------------

    Many thanks in advance

    Adriano


    Thursday, June 29, 2017 2:21 PM

All replies

  • Hi Adriano_risa,

    In the event that the Skype for Business OAuth configuration was previously defined with an incorrect ExchangeAutodiscoverUrl parameter, as could happen by accidentally using .xml instead .svc for example, then the following error may occur. 

    In fact if this parameter is null or invalid in any way then this error can occur.

    Test-CsExStorageConnectivity : ExCreateItem exchange operation failed, code=50043,

    To resolve the above error define the proper ExchangeAutodiscoverUrl in Skype for Business server using the Set-CsOAuthConfiguration cmdlet as outlined earlier.

    For more details, please refer to
    http://blog.schertz.name/2015/09/exchange-and-skype-for-business-integration/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    Regards,

    Alice Wang


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

    Friday, June 30, 2017 4:54 AM
    Moderator
  • Hi Alice

    Thanks for your answer, but the URL is already set correctly:

    PS H:\> Get-CsOAuthConfiguration

    Identity                               : Global
    PartnerApplications                    : {Name=Exchange;ApplicationIdentifier=00000002-0000-0ff1-ce00-000000000000;Real
                                             m=domain.local;ApplicationTrustLevel=Full;AcceptSecurityIdentifierInformation
                                             =False;Enabled=True}
    OAuthServers                           : {}
    Realm                                  : domain.com
    ServiceName                            : 00000004-0000-0ff1-ce00-000000000000
    ClientAuthorizationOAuthServerIdentity :
    ExchangeAutodiscoverUrl                : https://autodiscover.domain.com/autodiscover/autodiscover.svc
    ExchangeAutodiscoverAllowedDomains     :

    I can also access the site without certificate warnings. I see, that the realm behinde Partner Applications is domain.local. Is that correct?

    Regards

    Adriano





    Friday, June 30, 2017 7:10 AM
  • Hi Adriano,

    Did you manage to get your issue fixed? I have same issue in my environment.

    Thanks

    Jasper

    Friday, April 20, 2018 7:30 AM
  • have you fix the issue, i have the same Problem.
    Friday, March 1, 2019 4:07 PM