You must utilize a for loop with the ping command in. Ping.exe -t $IP|Foreach | Out-File -LiteralPath $LogPathīut he does not know why the script do not work when i execute it from double click or right-click -> open with -> powershell. You need to perform a basic ping scan and write the output file to a text file named 10-PingSweep.txt. My script: $enddate = (Get-Date).tostring("yyyyMMdd") First bit working fine for me: ping -t 195.40.1.36 find /v 'Reply from 195.40.1.36' > pinglog. It's the time and date thing that's got me stumped. Echo 1, Ping request could not find host. I am trying to ping a list of machines, do an nslookup on the ip addresses, then if hostname is same as original hostname, read from another txt file to output possible location of hostname. How can i "ping -t" the 3 IPs simultaneously and export the result in 3 different files? I would like to leave a ping running (ping -t) and have any response that is a not a reply be written to a text file along with the time and date. Combination Ping, NSLOOKUP and echo from txt file script. I know that the first ping has to be done to go the the next one becaucause when i "ping -n 1" (only one ping), it create the 3 txt files as expected. The script kind of work but it only create the first. txt file but i don't know how to ping the 3 IPs in parralel. I want to ping continuously (ping -t) 3 differents IPs simultaneously and export the result with a timestamp in 3 different.
0 Comments
Leave a Reply. |