Advertisement
mikedopp

TCP_Activity_LOG

Sep 2nd, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.96 KB | None | 0 0
  1. :: COMMENT:  This script shows all connections, listening ports, applications
  2. ::           making a connection and display full DNS name for each connection
  3. ::           for easier understanding of where the connections are being made.
  4. ::           -n option to only display the IP address. The 4 option will poll
  5. ::           every 4 seconds for connections to make it east to track what is going on.
  6. ::           The results are piped to a txt file. Create a txt file with a list of servers/workstations.
  7. ::           Modified 6-17-2015
  8. :::::::
  9. @echo off
  10. cls
  11. echo ** This gathers TCP activity on this server **
  12. echo.
  13. :: Prompt for Server Name
  14. SET /P ServerName=" Enter Server Name : "
  15. echo.
  16. echo ** Data is being gathered, please wait **
  17. echo.
  18. echo ** To stop data collection, use CTRL+C **
  19. netstat -abfn 4 >> %ServerName%-TCPActivity.txt
  20. echo.
  21. echo ** Processing is done, %ServerName%-TCPActivity.txt file will now open **
  22. notepad.exe %ServerName%-TCPActivity.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement