Count Network Connections

From NazimWIKI
Revision as of 00:29, 9 November 2019 by Admin (talk | contribs) (Created page with "To get a count of the number of network connections on a Windows server, you can use the following batch script: <blockquote><pre> REM list network connections and write them...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To get a count of the number of network connections on a Windows server, you can use the following batch script:

REM list network connections and write them to a file
netstat -n > netstat_count.txt

REM search for non-existent string in file and return line count instead
find /v /c "zzz" netstat_count.txt

This returns something like ...
---------- NETSTAT_COUNT.TXT: nnn