< Back

Get-DbaMsdtc

Mon Jan 13, 2020 11:18 am

NAME Get-DbaMsdtc



SYNOPSIS

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





SYNTAX

Get-DbaMsdtc [[-ComputerName] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>] [[-Credential]

<Pscredential>] [-EnableException <Switch>] [<CommonParameters>]





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





PARAMETERS

-ComputerName [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

The target computer.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Credential [<Pscredential>]

Alternative credential



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Msdtc, dtc

Author: Klaas Vandenberghe (@powerdbaklaas)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS

https://dbatools.io/Get-DbaMsdtc