Hello, This is relate to my previous PostPing host from ip list with powershell
I need to use this script (if possible) to ping some hosts for X hours for example each 5 minutes, and get result in a file,
Result file need to have date/time and if host is Up or Down
GC C:\Users\gemela\Desktop\Ping\hnames.txt | %{
If (Test-Connection $_ -Quiet -Count 2){
"$_ is UP"
}
Else{
"$_ is Down"
}
} | Out-File C:\Users\gemela\Desktop\Ping\ping_result.txt
Thanks