Enumerate Active Connections on port 1433:
netstat -aon | find ":1433 "
Count Active Connections on port 1433:
netstat -aon | find /c ":1433 "
To Enumerate and Count Active Connections on port 1433 and 443
ECHO This is the log for %date%: >> C:\logs\log.txt ECHO Current number of connections to 1433: >> C:\logs\log.txt netstat -aon | find /c ":1433 " >> C:\logs\log.txt ECHO Connections: >> C:\logs\log.txt netstat -aon | find ":1433 " >> C:\logs\log.txt ECHO Current number of connections to 443: >> C:\logs\log.txt netstat -aon | find /c ":443 " >> C:\logs\log.txt ECHO Connections: >> C:\logs\log.txt netstat -aon | find ":443 " >> C:\logs\log.txt