Configure the Windows Firewall to Allow SQL Server Access
Using PowerShell to configure the Windows Firewall can be quite useful at time. Below is a snippet that will allow SQL Server (port 1433) through the firewall.
Note: We use the "netsh firewall" command is deprecated. You now need to use the "netsh advfirewall firewall" command.
Run with elevated PowerShell prompt:
Deprecated snippet:
Note: We use the "netsh firewall" command is deprecated. You now need to use the "netsh advfirewall firewall" command.
Run with elevated PowerShell prompt:
netsh advfirewall firewall add rule name = SQLPort dir = in protocol = tcp action = allow localport = 1433 remoteip = localsubnet profile = DOMAIN
Deprecated snippet:
netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT
Post a Comment