Saturday, November 24, 2012

How to add exceptions in Windows Firewall related to SQLServer through command prompt?

How to add exceptions in Windows Firewall related to SQLServer through command prompt?
What is WindowsFirewall:
Windows Firewall is a software component of Microsoft Windows that provides firewalling and packet filtering functions. It was first included in Windows XP and Windows Server 2003. Prior to the release of Windows XP Service Pack 2 in 2004, it was known as Internet Connection Firewall.

Basically we have to open 3 exceptions in windows firewall pertain to SQL Server.
Ø  SQLServerEngine  -  default port/ custom port, Port Type - TCP/IP
Ø  SQLServerSSIS – 135, Port Type - TCP/IP
Ø  SQLServerBrowser – 1434, Port Type – UDP
Following command will create exceptions in firewall pertain to SQL Server
netsh advfirewall firewall add rule name = SQLServerEngine dir = in protocol = tcp action = allow localport = 22001 remoteip = ANY profile = ANY
netsh advfirewall firewall add rule name = SQLServerSSIS dir = in protocol = tcp action = allow localport = 135 remoteip = ANY profile = ANY
netsh advfirewall firewall add rule name = SQLServerBrowser dir = in protocol = UDP action = allow localport = 1434 remoteip = ANY profile = ANY

No comments:

Post a Comment