Test port connectivity on a server with Powershell command

The telnet client isn’t part of the default install on Server 2008 R2, (although it can be an added feature) and telnet makes it very easy to confirm whether or not you are able to connect to a server on a given port. Powershell to the rescue! If you need to test port connectivity you can do this with the following Powershell command:-

 $socket = new-object System.Net.Sockets.TcpClient(“1.1.1.1”, “5723”)

 Replace the values in quotes with the actual IP address and port number.

Advertisements
This entry was posted in Misc Stuff, Powershell for SCOM. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s