Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save guillermo-musumeci/f9ea3e29e33f7f3f6a83400bbaa5f0ce to your computer and use it in GitHub Desktop.

Select an option

Save guillermo-musumeci/f9ea3e29e33f7f3f6a83400bbaa5f0ce to your computer and use it in GitHub Desktop.
# SQL Server Ports Firewall Rules
New-NetFirewallRule -DisplayName "SQL Server" -Direction Inbound –Protocol TCP –LocalPort 1433 -Action allow
New-NetFirewallRule -DisplayName "SQL Admin Connection" -Direction Inbound –Protocol TCP –LocalPort 1434 -Action allow
New-NetFirewallRule -DisplayName "SQL Server Browser" -Direction Inbound –Protocol UDP –LocalPort 1434 -Action allow
New-NetFirewallRule -DisplayName "SQL Service Broker" -Direction Inbound –Protocol TCP –LocalPort 4022 -Action allow
New-NetFirewallRule -DisplayName "Transact-SQL Debugger / RPC" -Direction Inbound –Protocol TCP –LocalPort 135 -Action allow
# SQL Analysis Ports Firewall Rules
New-NetFirewallRule -DisplayName "SQL Analysis Service" -Direction Inbound –Protocol TCP –LocalPort 2383 -Action allow
New-NetFirewallRule -DisplayName "SQL Analysis Browser" -Direction Inbound –Protocol TCP –LocalPort 2382 -Action allow
# Shared Ports Firewall Rules
New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound –Protocol TCP –LocalPort 80 -Action allow
New-NetFirewallRule -DisplayName "SSL" -Direction Inbound –Protocol TCP –LocalPort 443 -Action allow
# Enable Windows Firewall
Set-NetFirewallProfile -DefaultInboundAction Block -DefaultOutboundAction Allow -NotifyOnListen True -AllowUnicastResponseToMulticast True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment