0

Can you please help me with a PowerShell script to ping a list of servers from a selected source and provide the output of failed and successful in CSV format

Can you please help me with a PowerShell script to ping a list of servers from a selected source and provide the output of failed and successful in CSV format?

tried the below batch script but a blank ping.txt came up.

@echo off
type NUL > ping.txt
FOR /F "tokens=1 delims= " %%D IN (import.csv) DO (
FOR /F "tokens=3 delims= " %%S IN (import.csv) DO (
ping `%%D` -l 0 -S `%%S` >> ping.txt
))

0 Answers0