Category Archives: Windows Server 2008

Opening firewall ports for SQL Server on Windows Server 2008

Check out Microsoft article http://support.microsoft.com/kb/968872 for a quick way to open the necessary ports for SQL Server on Windows Server 2008.

The batch file below (from link above) does the trick:

netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80

@echo =========  SQL Server Ports  ===================
@echo Enabling SQLServer default instance port 1433
netsh advfirewall firewall add rule name="SQL Server" dir=in action=allow protocol=TCP localport=1433
@echo Enabling Dedicated Admin Connection port 1434
netsh advfirewall firewall add rule name="SQL Admin Connection" dir=in action=allow protocol=TCP localport=1434
@echo Enabling Conventional SQL Server Service Broker port 4022
netsh advfirewall firewall add rule name="SQL Service Broker" dir=in action=allow protocol=TCP localport=4022
@echo Enabling Transact SQL/RPC port 135
netsh advfirewall firewall add rule name="SQL Debugger/RPC" dir=in action=allow protocol=TCP localport=135
@echo =========  Analysis Services Ports  ==============
@echo Enabling SSAS Default Instance port 2383
netsh advfirewall firewall add rule name="Analysis Services" dir=in action=allow protocol=TCP localport=2383
@echo Enabling SQL Server Browser Service port 2382
netsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=TCP localport=2382

@echo =========  Misc Applications  ==============
@echo Enabling HTTP port 80
netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80
@echo Enabling SSL port 443
netsh advfirewall firewall add rule name="SSL" dir=in action=allow protocol=TCP localport=443
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=UDP localport=1434
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE
Advertisements

Different ways of finding Windows uptime

1) Using Event Viewer

Filter on Event ID 6005.

The date and time when the Event ID 6005, The Event log service was started, is logged is the time when the Windows system was started.

Advantages:

  • You can see all startup times
  • Can also be used on remote systems.

2) From command line

Go to Start, Run. Type Cmd (Enter). On the command prompt type: net stats srv

Look for the text: Statistics since … For example: Statistics since 18/09/2009 9:34:09, meaning the Windows system was started on 18/09/2009 at 9:34:09.

You can also use the FIND command to retrieve only the line containing the time when the machine started.

net stats srv | find /i “statistics since”

See also http://support.microsoft.com/kb/555737