PDA

View Full Version : Firewall, SB7, SQL2005, Win2008



NewsArchive
12-23-2009, 02:47 AM
Using SB7, entered SQL Firewall exceptions for SQL Express 2005 server.
works beautifully, on XP, and 2003 Server. However, i am seing odd results
on Win7 and 2008 Server.

on 7/8, the exceptions are there, but I cannot connect to the SQL database.
If I turn off the firewall alltogether, then I can access it fine.
The ports I am opening are:
TCP 1433 (for SQL)

I am also addin ecceptions for all of my applications (4 EXE files)

Any ideas?

Glenn Paschal

NewsArchive
12-23-2009, 02:48 AM
Ok, I just found the problem.
It is not the ports, it is SQL.
SQL Express (Or SQL Named Instance) uses dynamic port assignment. I had
forgotten this.
So, on my test box, where we had already turned dynamic port off, everything
worked great.

Anyway....

Anyone know of a way to turn dynamic ports off either during SQL
installation (command prompt install), or programattically after
installation?
Any help would be greatly appreciated!

Thanks,
-Glenn.

NewsArchive
12-31-2009, 01:01 AM
Ok, if anyone is interested, you don't have to do anything with ports in
order to make SQL run thru the firewall.
Just add SQL (sqlservr.exe) as a program exception.

For Express 2005 (Using SB's SQL installer, of course) I added 2 lines of
code, and then added the exception as follows:

Set Variable %SQL_MSSQLKEY% to FUNCTION:Get Registry Key
Value("MyNamedInstance") from
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance
Names\SQL"

Set Variable %SQL_SERVERBINPATH% to FUNCTION:Get Registry Key
Value("SQLBinRoot") from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SQL Server\%SQL_MSSQLKEY%\Setup"

Add Firewall Exception(Application) "%SQL_SERVERBINPATH%\sqlservr.exe" --
Friendly Name: "Microsoft SQL Server"

Maybe this will help someone. It made my life way easier!
This will allow connectivity thru Windows Firewall via dynamic ports (used
by default in express and any version with a named instance).

I have tested this with WinXP, Win7, Win2003Svr, Win2008Svr.

Thanks,
-Glenn.

NewsArchive
12-31-2009, 01:04 AM
Glenn,

> Ok, if anyone is interested, you don't have to do anything with ports in
> order to make SQL run thru the firewall.
> Just add SQL (sqlservr.exe) as a program exception.

Thanks for sharing this interesting information!

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner