Powershell Ping


This is a basic powershell script for pinging a subnet to see which hosts respond.  Status 0 indicates the host responds while status 11003 indicates that no host is responding on that address.  Over the next couple of days i will be expanding on this script to export the results to excel and add more user variables

1
2
3
4
5
6
$i = 0
while ($i -lt 255){
   $i += 1
   $a = get-WmiObject Win32_PingStatus -f "Address='192.168.1.$i'"
   Write-Host $a.Address, $a.statuscode
   }

,

  1. No comments yet.
(will not be published)