Wednesday, January 12, 2011

How can I get a list of shared directories on local Windows server?

If I have a Windows server (typically 2000, 2003 or 2008), is there a simple way to list all local directories shared on that server?

I can find the shares themselves easily enough, but I would love a quick way to find the local directories they represent on disk.

Thanks!

  • You can go into computer management (right click my computer, select manage), expand the shares node and see a list of all shares, connected sessions and open files.

    alt text

    SQLChicken : Thanks for screenshot. In future you should also outline and describe exactly how to get to what you're posting just in case the picture isn't available in the future.
    From Sam Cogan
  • For a quick-and-dirty list, from a command-prompt execute "NET SHARE". The only problem with this command is that it thoughtfully formats data into columns and potentially cuts off long paths.

    You may be better served by doing at

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Shares
    

    with REGEDIT. You can export this as-desired.

  • Right click on your My Computer icon and choose Manage.

    In the window that opens, look in the tree on the left for the icon labeled Shared Folders and expand it to find another icon labeled Shares. Click here and you should see a list of all current shares.

    From Joel Coel
  • Use WMI: Win32_Share.

    In PowerShell:

    gwmi -class Win32_Share
    

    This also includes the system provided shares and will work remotely.

    THe resulting object's Path property is the local path.

    From Richard
  • net share from a command prompt will give you the share name and path. If you need something more advanced, you could query WMI using VBScript or PowerShell.

  • From a command line prompt, you can use the "net share" command. It will print a table with the list of the share name, the resource and an optional remark.

    Fatherjack : This is the best bet (along with using alternate languages in Graeme's answer below), in my opinion.
    From Benoit

0 comments:

Post a Comment