Powershell version of Telnet

Below is a quick way to perform a telnet session on a server that is not allowed to have the telnet client for some reason(compliance).
## Create Socket Object
$Socket=New-ObjectNet.Sockets.TcpClient# Suppress error messages
$ErrorActionPreference=SilentlyContinue# Try to connect

if ($Socket.Connected)
write-host“Port 443 is open”$Socket.Close() ## Destroy the connection
write-host“Port 443 is not open”

Leave a Reply

Your email address will not be published. Required fields are marked *