commands

^

Get-DbaMsdtc

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.

Synopsis

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

Description

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

Syntax

Get-DbaMsdtc
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaMsdtc -ComputerName srv0042

Get DTC status for the server srv0042

Example: 2
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

Example: 3
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

Example: 4
PS C:\> Get-DbaMsdtc -ComputerName srv0042 | Out-Gridview

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

Optional Parameters

-ComputerName

The target computer.

Alias cn,host,Server
Required False
Pipeline true (ByValue)
Default Value $env:COMPUTERNAME
-Credential

Alternative credential

Alias
Required False
Pipeline false
Default Value
-EnableException

By default in most of our commands, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This command, however, gifts you with "sea of red" exceptions, by default, because it is useful for advanced scripting. Using this switch turns our "nice by default" feature on which makes errors into pretty warnings.

Alias
Required False
Pipeline false
Default Value False