{"id":2422,"date":"2023-02-23T12:03:59","date_gmt":"2023-02-23T10:03:59","guid":{"rendered":"https:\/\/itsimple.info\/?p=2422"},"modified":"2023-02-23T12:04:01","modified_gmt":"2023-02-23T10:04:01","slug":"ping-multiple-ip-for-testing-network-disconnecting-issue","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=2422","title":{"rendered":"ping multiple IP for Testing Network disconnecting Issue"},"content":{"rendered":"\n<p>Sometime you can have network disconnecting or disrupting for short  period of time, a simple ping test will help a lot to diagnose the issue. PING with log example (without echo to screen): <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Ping.exe -t google.com | ForEach {\"{0} - {1}\" -f (Get-Date),$_} > C:\\tmp\\ping-log.txt\n<\/pre>\n\n\n\n<p>A PING with output to Screen:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Ping.exe -t google.com | ForEach-Object {\"{0} - {1}\" -f (Get-Date),$_} | Tee-Object C:\\tmp\\ping-log.txt -Append<\/pre>\n\n\n\n<p>A greate tool I have found at nirsoft will cover all your ping needs including email on failure and multiple servers pinging :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"209\" src=\"https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/pinginfoview.gif\" alt=\"\" class=\"wp-image-2423\"\/><\/figure>\n\n\n\n<p>Here is the script of sending email:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$Username = \"YourMailUser\";\n$Password = \"YourMailPassword\";\n$SendTo = \"sendto@yourdomain.com\";\n$MailServer = \"mail.yourdomain.com\";\n$HostName = $args[0];\n$IPAddress = $args[1];\n$PingStatus = $args[2];\n$FailedOn = $args[3];\n\n$message = new-object Net.Mail.MailMessage;\n$message.From = $Username;\n$message.To.Add($SendTo);\n$message.Subject = \"Failed Ping On $HostName\" ;\n$message.Body = \"Information about the failed ping: `r`nHost Name: $HostName`r`nIP Address: $IPAddress`r`nPing Status: $PingStatus`r`nPing Time: $FailedOn\";\n\n$smtp = new-object Net.Mail.SmtpClient($MailServer, \"587\");\n$smtp.EnableSSL = $true;\n$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);\n$smtp.send($message);<\/pre>\n\n\n\n<p>Save this as Powershell script and use it as needed (set your own settings in it)&#8217; in this example &#8220;send_message_failed_ping.ps1&#8221;<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"707\" src=\"https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/failed-ping-powershell-send-email-command.png\" alt=\"\" class=\"wp-image-2424\" srcset=\"https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/failed-ping-powershell-send-email-command.png 564w, https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/failed-ping-powershell-send-email-command-239x300.png 239w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">You can download the utility from <a href=\"https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/pinginfoview.zip\" data-type=\"URL\" data-id=\"https:\/\/itsimple.info\/wp-content\/uploads\/2023\/02\/pinginfoview.zip\">here<\/a>(local copy of the util , may be out of date) :<\/p>\n\n\n\n<p><a href=\"https:\/\/www.nirsoft.net\/utils\/multiple_ping_tool.html\">https:\/\/www.nirsoft.net\/utils\/multiple_ping_tool.html<\/a>     direct link:  <a href=\"https:\/\/www.nirsoft.net\/utils\/pinginfoview.zip\">https:\/\/www.nirsoft.net\/utils\/pinginfoview.zip<\/a><\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-vivid-green-cyan-color has-text-color has-large-font-size\"><blockquote><p>Good Luck<\/p><\/blockquote><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Sometime you can have network disconnecting or disrupting for short period of time, a simple ping test will help a lot to diagnose the issue. PING with log example (without echo to screen): Ping.exe -t google.com | ForEach {&#8220;{0} &#8211; {1}&#8221; -f (Get-Date),$_} > C:\\tmp\\ping-log.txt A PING with output to Screen: Ping.exe -t google.com | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,4,12,14,15],"tags":[],"class_list":["post-2422","post","type-post","status-publish","format-standard","hentry","category-operating-systems","category-tech","category-tutorials","category-windows","category-windows-server"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2422"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/2422\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}