Enumeration of shares using VBSCRIPT

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Doumani (ddoumani_at_doumaniweb.com)
Date: 02/03/05


Date: Thu, 3 Feb 2005 10:40:57 -0500

I am trying to write a script to enumerate all the shares on a machine, it's
physical path and the permissions of the shares. I was using strKeyPath =
"SYSTEM\CurrentControlSet\Services\lanmanserver\Shares" for the enumeration
of the shares but it occured to me that I am getting shares that do not
exist since they used to just delete folders without removing the share
first... some sevrers have over 1000 shars that donot really exist. My
purpose is two fold here... 1) to generate a report of the shares,
permissions and physical paths for a DR document as well as 2) to use the
same document to recreate the shares after I delete the
"SYSTEM\CurrentControlSet\Services\lanmanserver\Shares" and "..\security"
paths to eliminate all the event log errors where it can not create a share
due to the physical path not being avialable.

Does anyone have a script that will enumerate all the active shares on a
machine that I can take a look at?

Thanks
David



Relevant Pages

  • Re: Auditing a Domain from a Guest Account
    ... In NT4 Guests can enumerate users & groups and shares, ... NTFS permissions usually not; you can only enumerate what you can ... Am I nuts for even entertaining the notion that a guest account ...
    (comp.os.ms-windows.nt.admin.security)
  • RE: Enumeration of shares using VBSCRIPT
    ... > physical path and the permissions of the shares. ... > Does anyone have a script that will enumerate all the active shares on a ...
    (microsoft.public.scripting.vbscript)
  • Scripting Share Permissions
    ... How can I list share permissions via command line ... I need to enumerate all existing shares and who has ... server to server. ...
    (microsoft.public.win2000.security)
  • Re: removing user from domain users group doesnt help
    ... What I would do is to give that global group deny access this computer from ... only access shares on that server. ... give that group deny permissions for other shares on that server. ...
    (microsoft.public.windows.server.security)
  • Re: removing user from domain users group doesnt help
    ... user permissions to any shares and instead give permissions to the global groups you want to have access or give the global group deny permissions to the shares you don't want them to access or deny access this computer from the network user right for computers you don't want them to access shares on which can easily be managed via Group Policy. ... I have few shared folders on my w2k3 file server and most of them allow read access for the domain users group. ...
    (microsoft.public.windows.server.security)