Of you want to ping multiple hosts i.e. IP addresses at in parallel and then try this PowerShell script. This script will create an output file either .txt or .csv format.
$names=Get-content ".\ping_ip_address.txt"
foreach($name in $names)
{
if(Test-Connection -ComputerName $name -Count 1 -ErrorAction SilentlyContinue)
{
Write-Host "$name is Working" -ForegroundColor Green
$output+="$name is up,"+"`n"
}
else
{
Write-Host "$name is Not-Working" -ForegroundColor Red
$output+="$name is down,"+"`n"
}
}
$output | Out-File ".\ping_ip_address_result.csv"Â
Start-Sleep -s 100
https://learn.microsoft.com/en-us/answers/questions/692649/script-to-ping-multiple-hosts-and-return-if-the-ip
Â
Comments