From 1430fd13076181fb564d9a5110e4e0bab6f27c75 Mon Sep 17 00:00:00 2001 From: yangxiaodong Date: Wed, 28 Jun 2017 15:56:23 +0800 Subject: [PATCH] changed encode --- ConfigureMSDTC.ps1 | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ConfigureMSDTC.ps1 b/ConfigureMSDTC.ps1 index c9f4685..d574b34 100644 --- a/ConfigureMSDTC.ps1 +++ b/ConfigureMSDTC.ps1 @@ -1,6 +1,6 @@ -# ———————————— +# ———————————— # Enable MSDTC -# ———————————— +# ———————————— Write-Host "Enabling MSDTC..." -ForegroundColor Yellow $DTCSecurity = "Incoming" @@ -10,31 +10,31 @@ $RegPath = "HKLM:\SOFTWARE\Microsoft\MSDTC\" $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 { - 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 -Write-Host "——MSDTC has been configured—–" –foregroundcolor green +Write-Host "——MSDTC has been configured—–" –foregroundcolor green