Skip to content

Instantly share code, notes, and snippets.

@arebee
Created May 3, 2016 07:24
Show Gist options
  • Save arebee/25dc6fa51375bc41c88d810ae5b98037 to your computer and use it in GitHub Desktop.
Save arebee/25dc6fa51375bc41c88d810ae5b98037 to your computer and use it in GitHub Desktop.
# Scans the 192.168.1.nnn hosts for http responses.
for ($i = 1; $i -ile 254; $i++) {
$testAddress = "192.168.1." + $i
$info = Test-NetConnection -ComputerName $testAddress -CommonTCPPort http -InformationLevel Quiet
if ($info -eq $true)
{
write-host "$testAddress is listening on 80 for HTTP traffic"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment