PowerShell One Liner to check Port Status

"It's been an hour I was waiting for my Network Engineer to confirm the Opened Port Status of the server. I have heard this many times during my SharePoint Server Configurations at clients place."

This is pretty old but a very good tip for many Admins.

Use PowerShell one liner to check the Port status:

New-Object  System.Net.Sockets.TcpClient -ArgumentList "Localhost" , '5985'
Client              : System.Net.Sockets.Socket
Available           : 0
Connected           : True
ExclusiveAddressUse : False
ReceiveBufferSize   : 8192
SendBufferSize      : 64512
ReceiveTimeout      : 0
SendTimeout         : 0
LingerState         : System.Net.Sockets.LingerOption
NoDelay             : False

Enjoy PowerShell :)

Other Languages
This article is also available in the following languages: