How can I have list of shares on a machine into a text file?

I need the ability to have a file or files with the list of avaliable shares on three machines so that I can search for a specific share at anytime without having to interigate each machine everytime. The only time I have seen this type of list is like the one that appears when you connect to a machine via “Go to server” or Chooser. Is this possible???

This might get you started.

Using niutil, you can extract most of the configuration options of your system, including shares. It’s just a matter of knowing what parts to ask for.

In this case:

do shell script “niutil -list . /config/SharePoints”

or

do shell script “niutil -list . /exports”

will each give you a list of shares.

You can either call this dynamically (it’s pretty lightweight), or save the output into a text file for later reading. The dynamic option has the advantage that it’ll never be out of date with how the system is configured.

From a scripting point of view, one line of ‘do shell script’ isn’t a lot different from one line of ‘read file’.