

{"id":1045,"date":"2020-04-30T16:26:24","date_gmt":"2020-04-30T06:26:24","guid":{"rendered":"https:\/\/kng.tech\/blog\/?p=1045"},"modified":"2020-04-30T16:28:29","modified_gmt":"2020-04-30T06:28:29","slug":"use-powershell-to-ping-and-output-to-log-file","status":"publish","type":"post","link":"https:\/\/kng.tech\/blog\/use-powershell-to-ping-and-output-to-log-file\/","title":{"rendered":"Use powershell to ping and output to log file"},"content":{"rendered":"<p>Copy following in a batch file, and you could ping multiple address at once and logged it to files:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">start powershell.exe -Command \"ping -t 8.8.8.8 | ForEach {'{0} - {1}' -f (Get-Date),$_} &gt;&gt; C:\\Logs\\Dot8.log\"\r\nstart powershell.exe -Command \"ping -t 10.0.0.1 | ForEach {'{0} - {1}' -f (Get-Date),$_} &gt;&gt; C:\\Logs\\GW.log\"\r\nstart powershell.exe -Command \"ping -t 10.0.0.60 | ForEach {'{0} - {1}' -f (Get-Date),$_} &gt;&gt; C:\\Logs\\DC.log\"<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Copy following in a batch file, and you could ping multiple address at once and logged it to files: start powershell.exe -Command \"ping -t 8.8.8.8 | ForEach {'{0} - {1}' -f (Get-Date),$_} &gt;&gt; C:\\Logs\\Dot8.log\" start powershell.exe -Command \"ping -t 10.0.0.1 | ForEach {'{0} - {1}' -f (Get-Date),$_} &gt;&gt; C:\\Logs\\GW.log\" start powershell.exe -Command \"ping -t 10.0.0.60 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[91,43],"class_list":["post-1045","post","type-post","status-publish","format-standard","hentry","category-tech","tag-ping","tag-powershell"],"_links":{"self":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/1045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/comments?post=1045"}],"version-history":[{"count":3,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/1045\/revisions"}],"predecessor-version":[{"id":1057,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/1045\/revisions\/1057"}],"wp:attachment":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/media?parent=1045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/categories?post=1045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/tags?post=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}