Posted On August 2, 2022

PowerShell: Enable TLS 1.2 on Windows

kimconnect 0 comments
blog.KimConnect.com >> Windows >> PowerShell: Enable TLS 1.2 on Windows
function enableTls12{
	try{
		$null=New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Force
		$null=New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Force
		$null=New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'Enabled' -value '1' –PropertyType 'DWORD'
		$null=New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'DisabledByDefault' -value '0' –PropertyType 'DWORD'
		$null=New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'Enabled' -value '1' –PropertyType 'DWORD'
		$null=New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'DisabledByDefault' -value '0' –PropertyType 'DWORD'
		Write-Host "TLSv1.2 has been enabled on $env:computername"
	}catch{
		write-warning $_
	}
}

enableTls12

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Some WSUS Troubleshooting Notes

Some errors and interpretations: 0x8024401c: networking generic error 0x80244022: downloading generic error     Check…

PowerShell: Quick 1-Liner to Locate Path to Executable

PS C:\Users\tester> (get-command robocopy.exe) | select DefinitionDefinition----------C:\Program Files (x86)\Windows Resource Kits\Tools\robocopy.exeC:\Windows\system32\Robocopy.exe

Server PDC Time Clock Synchronization 

Configuring the Windows Time service to use an external time source To configure an internal…