Ping a range of IPV4 and resolve its hostnames via PowerShell. Here’s a simple PowerShell code snippet to ping a range of an IPV4 addresses and any IP address that will reply will be shown as per the sample output below. #====================== ( 240 .. 254 | ForEach { write $_ Test-Connection -computername "192.168.8. $_ " -count 1 -erroraction 'silentlycontinue' | Format-Table -AutoSize }) #====================== 240 .. 254 –- change this to a desired IP range from 1 to 254. 192.168.8. $_ -- change this IP Address on the IP Address configured or set on the network -count 1 –- ping 1 time -erroraction 'silentlycontinue' –- this will not display any errors on the screen if the IP Address can’t be found or is not set to reply to ICMP or ping protocol Format-Table -AutoSize –- if the device will reply with the hostname then the full name will be displayed on the screen and not trunca...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.