Just type netstat -a in command prompt & press enter. This will print a list of all active TCP & UDP ports running on your machine.

enter image description here

More detail about this command netstat can be found on below link.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat