PoweShell PingSweep 1

PoweShell PingSweep

1..255 | % {echo "192.168.1.$_"; ping -n 1 -w 100 192.168.1.$_} | Select-String ttl

Here is what the above code is Doing:
1. It’s creating a range of numbers from 1 to 255.
2. It’s piping that range of numbers to the echo command, which is printing out the IP address.
3. It’s piping that IP address to the ping command, which is pinging the IP address.
4. It’s piping the output of the ping command to the Select-String cmdlet, which is looking for the string “ttl”.
5. If the string “ttl” is found, the IP address is printed to the screen.

Similar Posts