title: How to fix the app event log warning MSDTC encountered an error (HR=0x80000171)
body: <p>I keep getting the following warning message in the application event log (Win2012R2):</p>
  
  <blockquote>
    <p>MSDTC encountered an error (HR=0x80000171) while attempting to
    establish a secure connection with system </p>
  </blockquote>
  
  <p>I have read all the related questions, and none of them helped resolve the issue.</p>
  
  <p>The application on that server works as expected as far as i can tell, but i don`t like the warning showing up, and need help resolving it.</p>
  
  <p>The warning happens once every few days, i can sometimes make it happen by restarting the MSDTC service.</p>
  
  <p>I have configured the DTC for network enabled transactions according to <a href="https://technet.microsoft.com/en-us/library/cc753620(v=ws.10).aspx" rel="nofollow noreferrer">this</a> MSDN article. </p>
  
  <p>The config shows up as expected on DTC startup:</p>
  
  <pre><code>MSDTC started with the following settings:
  
   Security Configuration (OFF = 0 and ON = 1):
   Allow Remote Administrator = 0,
   Network Clients = 1,
   Transaction Manager Communication: 
   Allow Inbound Transactions = 1,
   Allow Outbound Transactions = 1,
   Transaction Internet Protocol (TIP) = 0,
    Enable XA Transactions = 1,
    Enable SNA LU 6.2 Transactions = 1,
    MSDTC Communications Security = Mutual Authentication Required,
   Account = NT AUTHORITY\NetworkService,
    Firewall Exclusion Detected = 0
  
   Transaction Bridge Installed = 0
   Filtering Duplicate Events = 1
  </code></pre>
  
  <p>I also turned on the MSDTC CM trace, as specified in the <a href="https://support.microsoft.com/en-us/help/926099/how-to-enable-diagnostic-tracing-for-ms-dtc-on-a-windows-based-compute" rel="nofollow noreferrer">MSDN</a> </p>
  
  <p>In the trace file i found the following errors, but could not find any information on how to resolve them, so here we are.</p>
  
  <blockquote>
    <p>12-24-2017 14:18:46:354 : [ b9c. 2e8] 0x00000000 [    TRACE_CM] [ 
    TRACE_INFO] InitRpcSecurity
    (com\complus\dtc\dtc\cm\src\iomgrrpc.cpp@382): Calling
    RpcServerRegisterAuthInfo with mrfappdvl$@DEV.XXXX as SPN 12-24-2017
    14:18:46:885 : [ b9c. ba8] 0x00000000 [    TRACE_CM] [  TRACE_INFO]
    CRpcIOManagerServer::CheckTokenForWMIServiceSID
    (com\complus\dtc\dtc\cm\src\iomgrsrv.cpp@506):
    CheckTokenForWMIServiceSID - IsWMIService = 0 12-24-2017 14:18:46:900
    : [ b9c. ba8] 0x00000000 [    TRACE_CM] [  TRACE_INFO]
    CRpcIOManagerServer::CheckTokenForComputer
    (com\complus\dtc\dtc\cm\src\iomgrsrv.cpp@1009): <strong>Incoming caller is not
    in a domain</strong> 12-24-2017 14:20:32:035 : [ b9c. d5c] 0x800706d9 [<br>
    TRACE_CM] [ <strong>TRACE_ERROR</strong>] CRpcIOManagerClient::SetRpcSecurity
    (com\complus\dtc\dtc\cm\src\iomgrclt.cpp@547): [Remote:MRFAPPDVL
    b8f70426] <strong>Call to RpcEpResolveBinding failed</strong> 12-24-2017 14:20:32:035 :
    [ b9c. d5c] 0x80000171 [    TRACE_CM] [ TRACE_ERROR]
    CRpcIOManagerClient::SecureBuildContextWrapper
    (com\complus\dtc\dtc\cm\src\iomgrclt.cpp@749): [Remote:MRFAPPDVL
    b8f70426] Call to SetRpcSecurity failed 12-24-2017 14:20:32:035 : [
    b9c. d5c] 0x80000171 [    TRACE_CM] [ TRACE_ERROR]
    CRpcIOManagerClient::Bind
    (com\complus\dtc\dtc\cm\src\iomgrclt.cpp@312): [Remote:MRFAPPDVL
    b8f70426] SecureBuildContextWrapper call failed. <strong>This is usually due
    to security/network configuration issues.</strong></p>
  </blockquote>