This simple Powershell script will carry out a quick check against each IP in a 24 bit subnet and return a value of true or false dependent on whether or not it receives a reply. It’s similar to using an IP scanner or a ping script.
1 2 |
[cc lang="powershell"]$subnet = "10.20.6." 1..254 | Foreach-Object {write-host "$Subnet$_…" (Test-Connection -ComputerName "$Subnet$_" -Quiet -Count 1 ) }[/cc] |
It’s simple and does the job as it is however you could obviously make it more fancy by exporting to csv or an array or emailing the output etc etc.
Works fantastically. Nice and simple! Thank you for sharing