Open a command prompt, type netstat -A

If you want to output it to a file, type netstat -A >c:ports.txt

That will create a text file of all your ports.