forked from guillermo-musumeci/PowerShell-SQL-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigure-Windows-Firewall-SQL-Ports.ps1
More file actions
17 lines (14 loc) · 1.3 KB
/
Copy pathConfigure-Windows-Firewall-SQL-Ports.ps1
File metadata and controls
17 lines (14 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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