Sorry but this one wont work on a dedicated server.
However, it is client sided and can be used in every other server. :D
This exports to base/idlist.txt
However, that looks messy.
You can use processids(); to make a clean sorted list.
This exports to base/idlist2.txt
Put this in add-ons/client.