Skip to content

Instantly share code, notes, and snippets.

@MartinMiles
Last active December 17, 2021 21:37
Show Gist options
  • Save MartinMiles/899927b64c1cd2180784d1f563cdcbbc to your computer and use it in GitHub Desktop.
Save MartinMiles/899927b64c1cd2180784d1f563cdcbbc to your computer and use it in GitHub Desktop.
On Windows 11, disables TLS 1.3 over TCP, and start Marketing Automation service
Import-Module WebAdministration;
$XConnectSiteName = "xconnect.dev.local"; # or any other IIS website you'd want to process
if($Params.WindowsBuild -ge 22000){
Function ReplaceWebsiteBinding {
Param(
[string] $sitename,
[string] $oldBinding
);
$wsbindings = (Get-ItemProperty -Path "IIS:\Sites\$sitename" -Name Bindings)
for($i=0;$i -lt ($wsbindings.Collection).length;$i++){
if((($wsbindings.Collection[$i]).bindingInformation).Contains($oldBinding)){
($wsbindings.Collection[$i]).bindingInformation = $oldBinding;
($wsbindings.Collection[$i]).sslFlags=33
}
}
Set-ItemProperty -Path "IIS:\Sites\$sitename" -Name Bindings -Value $wsbindings
# Get-ItemProperty -Path "IIS:\Sites\$sitename" -Name Bindings
}
ReplaceWebsiteBinding "$XConnectSiteName" "*:443:$XConnectSiteName"
Restart-WebAppPool "$XConnectSiteName"
Start-Service -Name "$XConnectSiteName-MarketingAutomationService"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment