You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 line
1.5 KiB

  1. # ————————————
  2. # Enable MSDTC
  3. # ————————————
  4. Write-Host "Enabling MSDTC..." -ForegroundColor Yellow
  5. $DTCSecurity = "Incoming"
  6. $RegPath = "HKLM:\SOFTWARE\Microsoft\MSDTC\"
  7. #Set Security and MSDTC path
  8. $RegSecurityPath = "$RegPath\Security"
  9. Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccess" –value 1
  10. Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessClients" –value 1
  11. Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessTransactions" –value 1
  12. Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessInbound" –value 1
  13. Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessOutbound" –value 1
  14. Set-ItemProperty –path $RegSecurityPath –name "LuTransactions" –value 1
  15. if ($DTCSecurity –eq "None")
  16. {
  17. Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 1
  18. Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
  19. Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
  20. }
  21. elseif ($DTCSecurity –eq "Incoming")
  22. {
  23. Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
  24. Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
  25. Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 1
  26. }
  27. else
  28. {
  29. Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
  30. Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 1
  31. Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
  32. }
  33. Restart-Service MSDTC
  34. Write-Host "——MSDTC has been configured—–" –foregroundcolor green