I am looking for a way to list the shares of a remote machine. Using WMI works, but it's actually too robust because it returns special shares, and shares that don't appear if you navigate to \\machine_name in explorer.
I only want to be able to retrieve the shares that are shown when you navigate to the machine UNC path because I do not want to allow people to attempt to map special shares, since this will obviously fail, and is not what is expected behavior.
I tried using a DirectoryInfo object setting the path to be the machine name only, but it expects a path in the form of:
\\machine_name\share
But I simply want to list everything that is a folder under
\\machine_name
Does anyone happen to know how to do this? I've been searching for probably over a week now, and just coming up empty with the exception of the WMI stuff.
Thanks in advance.
I only want to be able to retrieve the shares that are shown when you navigate to the machine UNC path because I do not want to allow people to attempt to map special shares, since this will obviously fail, and is not what is expected behavior.
I tried using a DirectoryInfo object setting the path to be the machine name only, but it expects a path in the form of:
\\machine_name\share
But I simply want to list everything that is a folder under
\\machine_name
Does anyone happen to know how to do this? I've been searching for probably over a week now, and just coming up empty with the exception of the WMI stuff.
Thanks in advance.