Skip to content

Instantly share code, notes, and snippets.

View PracticalCode's full-sized avatar

George 2.0 Hope PracticalCode

  • Tenafly, NJ && NYC, NY
View GitHub Profile
@kiwi-cam
kiwi-cam / Start-Monitoring.ps1
Last active May 31, 2024 03:36
A simple Powershell script that monitors a remote hosts connection. Loops constantly reporting to the screen when the status changes. Optionally also records to the event log, makes an audible beep, and/or sends emails.
<#
.SYNOPSIS
Tests the connection to the supplied host or IP and reports back on changes to its status.
.DESCRIPTION
This script will check the connection to the supplied hostname or IP address every 5 second's to
monitor its status. If the status changes, a message is recorded, the Eventlog is update (optional), and an email is sent
to a supplied email address (optional).
If a TCPPort parameter is suppied the script will attempt to connect to this port. Otherwise a simple ICMP Ping is used.