If EnumNetworkConnections() doesn't already do what you want, I'd say it will get you going in the right direction.