Enumerating network shares
You can use NetShareEnum win32 api.
http://www.pinvoke.net/default.aspx/netapi32/netshareenum.html
Or look at the following project which is .NET Wrapper over it.
http://www.codeproject.com/KB/IP/networkshares.aspx
Enumerate list of network computers and shared folders in a tree view?
WNetOpenEnum will give you all the computers on the network
The WNetOpenEnum function starts an enumeration of network resources
or existing connections. You can continue the enumeration by calling
the WNetEnumResource function.
NetShareEnum will you all shares on a machine.
Retrieves information about each shared resource on a server.
You can use the combination of both to filter out what you don't want
Enumerate Windows network shares and all custom permissions on or within
I know it isnt scripting, but have you tried ShareEnum? http://technet.microsoft.com/en-us/sysinternals/bb897442.aspx and then export it out? You can also compare to older runs. I don't think there is a cmd line interface (which sucks), but it will get you the info you need
Why network shares enumeration is so slow on Windows?
As for why it is so slow, if a host is unavailable or not responding for whatever reason (requiring login credentials, for instance), Windows will wait for the timeout limit to be exceeded, for every share known in the network (which can be multiple per host). Windows' default timeouts are insanely long.
Reducing the timeout to something like 50ms (which should never be exceeded in a LAN) might help here, ultimately it depends on the amount of hosts tested.
I cannot help concerning alternatives towards the API, sorry.
Related Topics
How to Get the Value of Private Field Using Reflection
Does Using Parameterized SQLcommand Make My Program Immune to SQL Injection
How Does One Extract Each Folder Name from a Path
Configureawait Pushes the Continuation to a Pool Thread
Is Unityscript/JavaScript Discontinued
Generic List - Moving an Item Within the List
How to Use a C# Class Library in a Project
Rotate a Point by Another Point in 2D
How to Include Other Files to the Output Directory in C# Upon Build
Creating Directories in a Ziparchive C# .Net 4.5
How to Convert JSON Array to List of Objects in C#
Func Delegate with Ref Variable
Strange Behaviour of Console.Readkey() with Multithreading
C#: HTMLagilitypack Extract Inner Text