How to check Port 1433 is working for Sql Server or not?

前端 未结 1 1166
礼貌的吻别
礼貌的吻别 2021-02-14 23:33

How can I check whether port 1433 is open for Sql Server or not? I have set in bound and out bound rules, checked in SQL config manager but not sure whether it is working.

1条回答
  •  太阳男子
    2021-02-15 00:04

    If TELNET is installed, you could use TELNET 1433 to verify port connectivity. Otherwise, the PowerShell command below can do the job using a .NET TcpClient:

    $server="yourserver"; $port=1433; echo ((new-object Net.Sockets.TcpClient).Connect($server,$port)) "$server is listening on TCP port $port";
    

    Newer versions of PowerShell include a Test-NetConnection cmdlet to facilitate testing ICMP and port connectivity. Example invocation from a Windows command prompt:

    powershell -Command "Test-NetConnection -ComputerName 'yourserver' -Port 1433"
    

    0 讨论(0)
提交回复
热议问题