I"m not sure about the shares, but you can use DirectoryServices. Here's an
article I posted a while back that will get you all of the resources in AD:
Thanks for your post. You can take a look at Network Management Functions.
For example, calling NetGetJoinInformation to get a computer's domain name,
and NetShareEnum() to enumerate the shares of a machine.