

Use Test-NetConnection in PowerShell to See If A Port Is Open
source link: https://thomasrayner.ca/use-test-netconnection-in-powershell-to-see-if-a-port-is-open/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Use Test-NetConnection in PowerShell to See If A Port Is Open
The days of using ping.exe to see if a host is up or down are over. Your network probably shouldn’t allow ICMP to just fly around unaddressed, and your hosts probably shouldn’t return ICMP echo request (ping) messages either. So how do I know if a host is up or not?
Well, it involves knowing about what your host actually does. What ports are supposed to be open? Once you know that, you can use Test-NetConnection in PowerShell to check if the port is open and responding on the host you’re interested in.
PS> Test-NetConnection -ComputerName $computerName -Port 3389
ComputerName : <snip - name of the computer I'm testing>
RemoteAddress : <snip - IP address of the computer I'm testing>
RemotePort : 3389
InterfaceAlias : Ethernet
SourceAddress : <snip - my IP address>
TcpTestSucceeded : True
Here I just checked if port 3389 (for RDP) is open or not. Looks like it is.
Recommend
-
26
4 Port high power USB hub This project is about a high current USB 2.0 hub that is specifically designed to drive USB po...
-
9
Introduction In Fedora/CentOS/RedHat, the firewall is on by default. This is a good secure-by-default practice. If you do not know that the firewall is on though, you may be wondering why you cannot connect to a web service that is...
-
10
Abusing the one open port on a network to get things done Have you ever read about a trick and then thought it was ridiculous because you're too dignified to use something that dirty? Have you then found yourself in a situation w...
-
15
PSArm – PowerShell DSL For Azure Resource Manager – Introduction #PowerShell #AzureResourceManager Those who worked on Azure Resource Manager (ARM) templates understand that complexity of writing and making sure that the templ...
-
7
Port 5432 is open: introducing the Splitgraph Data Delivery NetworkWe launch the Splitgraph Data Delivery Network: a single endpoint that lets any PostgreSQL application, client or BI tool to connect and query over 40,...
-
8
With the .NET5 release further development of some projects was questionable due to the complexity of porting. One can abandon small outdated libraries or find a replacement. But it’s hard to throw away Microsoft.Office.Interop.Word.dll. Micr...
-
8
Start redis in Docker with a open port at localhost:6379 · GitHub Instantly share code, notes, and snippets. Start redis in Docker with a op...
-
9
See how Test Driven Development is done in practice July 5, 2009 On the Manning site you can read the 2nd chapter of the...
-
2
A Short Test to See if Your Job Will Survive AI
-
1
What To Do If Your Tesla's Charging Port Won't Open
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK