在 Windows 台服务器核心计算机上启用和配置 MS DTC

Enabling and Configuring MS DTC on Windows Server Core machines

由于我们使用 Entity framework 进行分布式事务,我们目前在所有环境中的 client/server 和 SQL 服务器盒上都启用了 DTC。

这很容易使用 How to Enable MSDTC on a Web Server 进行设置,而且效果很好。

但是我们的生产环境使用 Windows Server Core,这是一个基于命令行的基本环境。

如何在 Windows Server Core 机器上 enable/configure MS DTC?

从另一台计算机,您可以:

  • 运行 Dcomcnfg.exe
  • 右键单击控制台根/组件服务/计算机
  • select新/电脑
  • 添加您的服务器

Powershell

从 Server Core Powershell window 或使用远程 Powershell 会话,您可以使用 MS DTC cmdlet:Distributed Transaction Coordinator (MSDTC) Cmdlets in Windows PowerShell

你得根据自己的需求判断需要哪一个。

例如,您可以使用 Set-DtcNetworkSetting 来修改 DTC 实例的网络和安全配置。