Author | Klaas Vandenberghe (@powerdbaklaas) |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaMsdtc on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaMsdtc.
Displays information about the Distributed Transaction 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-DbaMsdtc
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaMsdtc -ComputerName srv0042
Get DTC status for the server srv0042
PS C:\> $Computers = (Get-Content D:\configfiles\SQL\MySQLInstances.txt | % {$_.split('\')[0]})
PS C:\> $Computers | Get-DbaMsdtc
Get DTC status for all the computers in a .txt file
PS C:\> Get-DbaMsdtc -Computername $Computers | Where-Object { $_.dtcservicestate -ne 'running' }
Get DTC status for all the computers where the MSDTC Service is not running
PS C:\> Get-DbaMsdtc -ComputerName srv0042 | Out-Gridview
Get DTC status for the computer srv0042 and show in a grid view
The target computer.
Alias | cn,host,Server |
Required | False |
Pipeline | true (ByValue) |
Default Value | $env:COMPUTERNAME |
Alternative credential
Alias | |
Required | False |
Pipeline | false |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |