How to save ping output into report using powershell
#Save PingStamp into Notepad using powershell
Its very usefull sourse to capture pingstamp into notepad for monitoring your network or your critical services over the network.
It is recommend if you create follder before appling commands
Create a folder where you will save all of your output
C:\Pingstamp (I have created folder in C:Drive)
Run following command in Powershell, It will create data file with
all commands and results you get in PS.
Start-Transcript -path C:/Pingstamp/PSLogs.txt –Append
Now you can run any command to save output in txt. and here we are running following PS command to save ping with timestamp
ping.exe -t shujjatshah.blogspot.com | foreach {"{0}
- {1}" -f (Get-Date),$_}
ping.exe -t DOMAINNAME OR IP | foreach {"{0} - {1}" -f (Get-Date),$_}
All above data is saved PSLogs.txt file under C:\Pingstamp
Thanks,
Comments
Post a Comment