We help IT Professionals succeed at work.

Ps and sql queries: firewall ports to open?

Hi,

I need to:
-connect to a server via powershell (execute invoke commands and enter pssessions)
-execute sql queries to another server

Both work on one w10 pc, not on another.
Which ports on the firewall I need to open
-for Powershell
-for sql queries?

Please advise
J
Comment
Watch Question

David Johnson, CDSimple Geek from the '70s
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:

sql usually communicates via tcp port 1433

Raheman M. AbdulMessaging and Directory Services
CERTIFIED EXPERT

Commented:

On the working WIN 10 PC, do you have SQL Browser service running? 

On non working PC, check the same service


Check sql modules installed on non working PC


CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Firewalls have logs. Let the firewall log blocked connections and you'll see which ports are tried.

Author

Commented:
No answer on ps, only sql. Just generic Gooagable answer without details/clarification
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Don't close questions before asking for clarification. Makes no sense.
"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015
Commented:
The default ports for PowerShell (using WinRM respective WS-Man) are 5985 (HTTP) and 5986 (HTTPS).

For SQL you need to be precise which product you mean. SQL is a language, not a server. If you mean MS SQL Server, 1433/tcp is indeed the default port (if running a sinlge instance), and 1434/udp is used to determine the port otherwise using SQL Browser.
Other DBMS use different ports.