Test network ports with Powershell

[codesyntax lang=”powershell”]

#Create socket object
$Socket = New-Object Net.Sockets.TcpClient

#Connect
$Socket.Connect("172.22.2.10", "8888")

#Check if connected
$Socket.Connected

#Close connection
$Socket.Dispose()

[/codesyntax]

This entry was posted in Network. Bookmark the permalink.