For added security, we're thinking of enabling the firewalls on our 2016 and 2019 servers. Currently, they're all behind our edge router/firewall, and every server has its firewall disabled. Sometimes, if the firewall is enabled and you install a program, it'll ask to create firewall rules automatically, and you're all set.
I'm going through NETSTAT with many different options/switches (i.e. NETSTAT -ano |Findstr LISTENING) to find out what ports each server is listening on and documenting them in a spreadsheet. When I began to notice many ephemeral ports being used, I suddenly realized this might not be as easy as I though. Then I thought to come here and ask. I tried googling it but all I find is info on how to open a port on a firewall that's already enabled. I would like to try and find out all the ports my servers are listening on so I can create firewall rules prior to enabling the firewalls. Is there a better way to do this than NETSTAT?
Thanks!