NetUseEnum or Net32UseEnum

The NetUseEnum API lists all current connections between the local computer and resources on a remote server.