Pinging IPs from a CSV file.

Good afternoon,

I have this basic script:

$ServerName = "INSERTIP", "INSERTIP", "INSERTIP" foreach ($Server in $ServerName) { if (test-Connection -ComputerName $Server -Count 2 -Quiet ) { write-Host "$Server has recieved the ping! " -ForegroundColor Green } else { Write-Warning "$Server is not recieving the ping, please check the connection!" } } pause 

Instead of listing out a massive messy list of IP addresses, I’d like the script to reference a CSV file or even a text file which I can add to when needed. Would anyone know how to implement this because I am honestly bashing my head against the wall.


submitted by /u/Fordragon18
[link] [comments]

Leave a Reply