This is a short post to share a PowerShell script that will create a new Windows Firewall Rule on a your computer. We have to ensure that we run PowerShell as Administrator for this to work.
# New firewall rule (run powershell as administrator) if (-not( Get-NetFirewallRule -DisplayName “Allow Inbound SQL (1433)” -ErrorAction SilentlyContinue)) { New-NetFirewallRule ` -DisplayName “Allow Inbound SQL - 1433” ` -Direction Inbound ` -Protocol TCP ` -LocalPort 1433 ` -Action Allow }
The above is creating a new firewall rule so inbound SQL Server (1433) traffic is allowed through on this computer.
For more information on managing the Windows Firewall, click the blog tag below!
Leave a Reply