Browse Source

changed encode

master
yangxiaodong 7 years ago
parent
commit
1430fd1307
1 changed files with 20 additions and 20 deletions
  1. +20
    -20
      ConfigureMSDTC.ps1

+ 20
- 20
ConfigureMSDTC.ps1 View File

@@ -1,6 +1,6 @@
# ————————————
# ————————————
# Enable MSDTC # Enable MSDTC
# ————————————
# ————————————


Write-Host "Enabling MSDTC..." -ForegroundColor Yellow Write-Host "Enabling MSDTC..." -ForegroundColor Yellow
$DTCSecurity = "Incoming" $DTCSecurity = "Incoming"
@@ -10,31 +10,31 @@ $RegPath = "HKLM:\SOFTWARE\Microsoft\MSDTC\"


$RegSecurityPath = "$RegPath\Security" $RegSecurityPath = "$RegPath\Security"


Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccess" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessClients" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessTransactions" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessInbound" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessOutbound" –value 1
Set-ItemProperty –path $RegSecurityPath –name "LuTransactions" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccess" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessClients" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessTransactions" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessInbound" –value 1
Set-ItemProperty –path $RegSecurityPath –name "NetworkDtcAccessOutbound" –value 1
Set-ItemProperty –path $RegSecurityPath –name "LuTransactions" –value 1


if ($DTCSecurity –eq "None")
if ($DTCSecurity eq "None")
{ {
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 1
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 1
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
} }
elseif ($DTCSecurity –eq "Incoming")
elseif ($DTCSecurity eq "Incoming")
{ {
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 1
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 0
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 1
} }
else else
{ {
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 1
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
Set-ItemProperty –path $RegPath –name "TurnOffRpcSecurity" –value 0
Set-ItemProperty –path $RegPath –name "AllowOnlySecureRpcCalls" –value 1
Set-ItemProperty –path $RegPath –name "FallbackToUnsecureRPCIfNecessary" –value 0
} }


Restart-Service MSDTC Restart-Service MSDTC
Write-Host "——MSDTC has been configured—–" –foregroundcolor green
Write-Host "——MSDTC has been configured—–" –foregroundcolor green

Loading…
Cancel
Save