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
$Socket.Connect(“192.168.1.5”,“443”)

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

Ping Last User GUI

PingLastUser

[
void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Drawing”)
[
void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)

## Some Variables To Use
$ComputerName=“”

## Main Window Size
$objForm=New-ObjectSystem.Windows.Forms.Form
$objForm.Text=“Ping Last User”
$objForm.Size=New-ObjectSystem.Drawing.Size(800,610)
$objForm.StartPosition=“CenterScreen”
$objForm.KeyPreview=$True

Continue reading