Question: I've read your post on Enable XA transactions for SQL Server , which outlines how to enable XA transactions via the Computer Services module. I'd like to integrate the enabling of XA transactions as part of a scripted SQL Server installation, whoch includes enabling XA transactions for some applications.
I'm using Powershell to develop the script . How can I see the current value and also change the value to enable XA ?
Answer: It is possible to access and set the MSDTC XA Transactions values using Powershell . You need to make sure your current login has the correct permissions.
To view the current XA transactions value use the following Get-ItemProperty command
Get-ItemProperty "HKLM:\\SOFTWARE\\Microsoft\\MSDTC\\Security\\" -Name "XaTransactions"
To enable the current XA transactions use the following Set-ItemProperty
Set-ItemProperty "HKLM:\\SOFTWARE\\Microsoft\\MSDTC\\Security\\" -Name "XaTransactions"
Read More on MSDTC
Unable to connect to Microsoft Distributed Transaction Coordinator ...
SQL Server – Deleting Distributed Orphaned Transactions
MS DTC and sys.dm_tran_active_transactions (SQL Server DBA)