Save the following as Opensql.bat double-click to run
Copy Code code as follows:
@echo ========= SQL Server Ports ===================
@echo Enabling SQL Server default instance port 1433
netsh firewall set portopening TCP 1433 "SQL Server"
@echo Enabling dedicated Admin Connection port 1434
netsh firewall set portopening TCP 1434 "SQL Admin Connection"
@echo enabling conventional SQL Server Service Broker Port 4022
netsh firewall set portopening TCP 4022 "SQL Service Broker"
@echo Enabling Transact-SQL DEBUGGER/RPC port 135
netsh firewall set portopening TCP 135 "SQL Debugger/rpc"
@echo ========= Analysis Services Ports ==============
@echo Enabling SSAS Default Instance Port 2383
netsh firewall set portopening TCP 2383 "Analysis Services"
@echo Enabling SQL Server Browser Service Port 2382
netsh firewall set portopening TCP 2382 "SQL Browser"
@echo ========= Misc Applications ==============
@echo Enabling HTTP Port 80
netsh firewall set portopening TCP "HTTP"
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"
@echo enabling port for SQL Server Browser Service ' Browse ' Button
netsh firewall set portopening UDP 1434 "SQL Browser"
@echo allowing multicast broadcast response on UDP (Browser Service enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE