IIS disable old protocols

# Requires administrative privileges

# Disable SSL 2.0
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -Name 'Enabled' -Value 0 -Type DWord

# Disable SSL 3.0
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Name 'Enabled' -Value 0 -Type DWord

# Disable TLS 1.0
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Name 'Enabled' -Value 0 -Type DWord

# Disable TLS 1.1
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -Name 'Enabled' -Value 0 -Type DWord

# Enable TLS 1.2 (Make sure it's enabled)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Name 'Enabled' -Value 1 -Type DWord
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Name 'Enabled' -Value 1 -Type DWord

# Restart IIS to apply changes
Restart-Service -Name IISAdmin -Force
Restart-Service -Name W3SVC -Force

# Output a message to indicate completion
Write-Host "SSL/TLS changes applied. SSL 2.0, SSL 3.0, TLS 1.0, and TLS 1.1 have been disabled. TLS 1.2 has been enabled. IIS has been restarted to apply these changes."

Leave a Reply

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