dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Displays information about the Distributed Transactioon Coordinator (MSDTC) on a server.

Returns a custom object with Computer name, state of the MSDTC Service, security settings of MSDTC and CID’s.

Requires: Windows administrator access on Servers.



Get DTC status for the server srv0042

Get-DbaMsdtc -ComputerName srv0042

Get DTC status for all the computers in a .txt file.

$Computers = (Get-Content D:\configfiles\SQL\MySQLInstances.txt | % {$_.split(‘\’)[0]})
$Computers | Get-DbaMsdtc

Get DTC status for all the computers where the MSDTC Service is not running.

Get-DbaMsdtc -Computername $Computers | where { $_.dtcservicestate -ne ‘running’ }

Get DTC status for the computer srv0042 and show in a grid view.

Get-DbaMsdtc -ComputerName srv0042 | Out-Gridview


This command was created by Klaas Vandenberghe. You can find Klaas on Twitter and his blog.


From PowerShell, execute Get-Help Get-DbaMsdtc -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaMsdtc.ps1 on GitHub

Related commands