[python-win32] Windows Server Share Info
Steven M. Faulconer
geek at cfl.rr.com
Thu Jan 15 19:09:17 EST 2004
I'm looking into writing a script to hunt down all open shares (everyone
permissions) on our servers and I'm having difficulties understanding
something. Right now, this is what I've got:
import win32net
shares = win32net.NetShareEnum("<servername>", 2)
shares is now a list, whith shares[0] being a list of dictionaries
containing the share information and shares[1] being the number of
shares found (please correct me if I am wrong). My problem is
interpretting some of the values in the shares[0] list, mainly type and
permissions. I've looked at the MSDN information, but it isn't being
very helpful. The 'permissions' key always has a '0' value, which
doesn't tell me much. The code is being executed by someone with
administrator privileges on all systems. The type is similarly
returning odd values, not quite what the MSDN site says it should. I'm
getting large negative numbers instead of STYPE*.
My guess is I'm doing this totally wrong, so any advice would be greatly
appreciated.
Thanks.
Steven
More information about the Python-win32
mailing list